Skip to main content
May 3, 2006
Answered

Inline XML parsing

Greetings,

I'm running CF MX7 and am using XMLparse to parse the following XML code.

XMLparse works fine and returns the proper structure (or so I thought). The description tag starts out with "Trout (" and then the inline strong tag surrounds 2 sets of text. with " and " in between, followed by a ")" at the end.

The structure for description clumps all of the text not with the strong tags into one XMLtext field ("Trout ( and )" ) and has two child nodes for each of the strong tags. I can parse everything out but cannot output the text in the proper order. I've parsed this XML with stylusStudio and it properly creates 3 description fields with the proper text within them and 2 strong fields.

Shouldn't XMLparse also be returning 3 description elements as well?

Thanks for any information...

This topic is closed to new replies. Start a new post to keep the conversation going.
rogbenCorrect answer
Participant
May 4, 2006
You need to ToString() the contents of the description element, and then strip out any extraneous XML declaration that the function adds. Unless you're using CF6.1, in which case you can use Java's toString() as a shortcut... it won't tack on the declaration.

2 replies

rogbenCorrect answer
Participant
May 4, 2006
You need to ToString() the contents of the description element, and then strip out any extraneous XML declaration that the function adds. Unless you're using CF6.1, in which case you can use Java's toString() as a shortcut... it won't tack on the declaration.
Translate
May 5, 2006
...that worked like a champ!

Thanks for your help.
Translate