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

help on how to parse some xml

Explorer ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

Hi I have the following bit of XML set to a variable like so:-

<cfset var = "
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
<note2>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note2>
">

Can anyone tell me how i can parse throught thuis data and turn it into a record set so that I can manipulate the data? I think i need to write an script for this but not sure of where to start?

ANy help appreciated

Thanks
TOPICS
Advanced techniques

Views

290

Translate

Translate

Report

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 ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

Start with this:

<cfset noteObj = xmlParse(var)> <!--- Note: 'var' is a bad variable
name, it is a keyword in ColdFusion --->

<cfdump var="#noteObj#">

Votes

Translate

Translate

Report

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
Explorer ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

Hi thanks for this. However I am running on Coldfusion 5 which does not have the xmlParse function. Is there another way to parse this xml?

Thanks

Votes

Translate

Translate

Report

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 ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

Is there another way to parse this xml?

Thanks

IIRC there are work arounds for CF 5, but I am not familiar with them.
I have not use CF 5 for five years or so.

Votes

Translate

Translate

Report

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 ,
Jan 25, 2007 Jan 25, 2007

Copy link to clipboard

Copied

LATEST
You can load in a 3rd party XML parser (such as Xerces or MSXML) using <cfobject>. You should be able to find some references through google on how to use them together.

Votes

Translate

Translate

Report

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
Documentation