XML error pasting Drag and Drop Queue sample code

  • 1
  • Problem
  • Updated 2 years ago
  • Acknowledged
I'm trying to follow the tutorial at https://docs.skuid.com/latest/en/skuid/javascript/snippets/queue-custom-item.html and copy-and-pasted the XML code from https://bitbucket.org/skuid/samplepages/src/1e02bf5a392e141442b992e270ce593345faa979/pages/Drag%20an... into a new Skuid page. However, I am getting the following error:

Failed to parse XML due to: entity reference names can not start with character '&' (position: TEXT seen ...el.registeredEditors,function(){\n if (this.element &&... @177:34) 

Any idea if there is something wrong with the sample code? Or am I doing something wrong?

Thanks,
Andrew
Photo of Andrew N

Andrew N

  • 1,178 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hello Andrew, thank you for bringing this to our attention. I was able to reproduce this error, and I'm bringing it to the appropriate people for further investigation.

Mark DeSimone
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hello Andrew, this is actually easily fixed by replacing each & with
& 
in the code on line 177. The trouble lies with how BitBucket's preview is displaying & in the browser. It's written the correct way in the raw code, but when BitBucket displays its preview on the page, the & special entity is being interpreted and replaced with the & character, which isn't valid for XML

So, if you paste the XML code on line 177 with the following, it should be interpreted correctly by our XML editor while it works to import the XML into a Skuid page.
if (this.element && this.element.is && this.element.is(queueElement)) {
The XML interpreter just isn't happy that there are &s present because those are reserved characters in XML. Of course they'd be perfectly allowed if this was a .js file, and they should be handled correctly once Skuid puts those Javascript snippets into action at runtime.

Hope this helps!
Mark
Photo of Andrew N

Andrew N

  • 1,178 Points 1k badge 2x thumb
Awesome - thank you Mark. Easy fix and I learned something too :)