troubleshooting Question

Nesting a XML tag in cfxml

Avatar of coconutelegraph
coconutelegraphFlag for United States of America asked on
Web Development SoftwareWeb Servers
5 Comments1 Solution290 ViewsLast Modified:
I'm creating an xml document from a query called qRead:
<cfxml variable="myDoc">
          <cfoutput query="qRead">

I have a requirement to nest certain elements depending on the circumstance. For example,  if <Text> This is the text I am writing </Text> it would remain as shown. However, if the <Display> element is before a <Text> element I will need to nest as follows:
     <Text> This is the text I am writing </Text>

This is important because it prepares the system to display the text. Any ideas on how I can accomplish this? Can I put <cfif> logic within the <cfoutput> tag to catch the <Display> tag? Once I have it, how could I ensure that the next <Text> tag is nested within the <Display> tag?

Thanks for your help.

Let me know if I need to clarify.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros