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

XML - including: "<?xml version="1.0" encoding="UTF-8"?>"

Participant ,
Nov 16, 2007 Nov 16, 2007
When I parse an XML document and output:
#xmlCode.XMLRoot.property.autoID#

I get this line before every field: <?xml version="1.0" encoding="UTF-8"?>

eg.
<?xml version="1.0" encoding="UTF-8"?>
<autoID>19</autoID>
<?xml version="1.0" encoding="UTF-8"?>
<autoID>53</autoID>
<?xml version="1.0" encoding="UTF-8"?>
<autoID>59</autoID>

How do I stop this? I just want the number from the field.

I also don't understand why it is UTF-8 when I specify iso-8859-1.
TOPICS
Getting started
2.5K
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

correct answers 1 Correct answer

Participant , Nov 17, 2007 Nov 17, 2007
Doh!

rsPropDataXML.XMLRoot.property.autoID = <?xml version="1.0" encoding="UTF-8"?>
<autoID>19</autoID>


rsPropDataXML.XMLRoot.property.autoID.xmlText = 19

i.e. the .xmlText is the answer!
Translate
Advisor ,
Nov 16, 2007 Nov 16, 2007
Please post your code
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
Engaged ,
Nov 16, 2007 Nov 16, 2007
If you use the CFXML tag, you dont need to do the <?xml version='1.0' encoding='iso-8859-1'?> line in your code. It will do it for you automatically.

Remove it and it should be fine.

EX:

<cfxml variable="rsPropDataXML" casesensitive="no">
<allData>
<cfoutput query="rsPropData" maxrows="20">
<property>
<autoID>#rsPropData.autoID#</autoID>
<Tour>#rsPropData.Tour#</Tour>
</property>
</cfoutput>
</allData>
</cfxml>


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
Participant ,
Nov 17, 2007 Nov 17, 2007
Thanks but it is still the same, every field has: <?xml version="1.0" encoding="UTF-8"?>

I am using CF8, MySQL5, DW CS3
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
Participant ,
Nov 17, 2007 Nov 17, 2007
LATEST
Doh!

rsPropDataXML.XMLRoot.property.autoID = <?xml version="1.0" encoding="UTF-8"?>
<autoID>19</autoID>


rsPropDataXML.XMLRoot.property.autoID.xmlText = 19

i.e. the .xmlText is the answer!
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