Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

"XML document structures must start and end within the same entity"

LEGEND ,
Aug 22, 2012 Aug 22, 2012

Hello, everyone.

As described in the subject, I am getting the error message "XML document structures must start and end within the same entity".  It is attributed to the <cfxml> tag in the following code:

<cfoutput query="qry" maxrows="1">

  <cfxml variable="xmldoc">#trim(REreplace(toString(content),"^[^<]*","","all"))#</cfxml>

  <cfset mydoc = toString(xmldoc)>

</cfoutput>

What is the best way to troubleshoot this issue?  The code is inherited, not mine.

Thank you,

^_^

5.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 22, 2012 Aug 22, 2012

The best way to troubleshoot it is to look at the output of #trim(REreplace(toString(content),"^[^<]*","","all"))#

If it does not produce XML that starts with the same element as it ends with, then you know what to fix.

Can you provide a sample of the output?

jason

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 22, 2012 Aug 22, 2012
LATEST

Hi, 12Robots, and thanks for the reply.

In order for me to provide a sample of the output, I would have to burn it from my dev machine (not connected to the internet) to CD to transfer to this (connected to the internet) computer.  Bosses are very security-conscious.

And after having hashed it out with a co-worker for half an hour, it turns out that the reason why it wasn't working was because the XML was being truncated.  No one told me to set the datasource (one of 12) to use BLOB/CLOB on my CF installation.  (sheepish grin)  Once I did that, it started working as expected. <sigh>

^_^

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources