|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
getting the element name in XML
Is there any provisions to display the Element name of an XML element. It's easy to get an attribute value but I could not find any easy way at all to get the names of the Elements.
For example, consider an XML element <leads> <address> <name>vvvvv</name> <city>wwww</city> <zip>11111</zip> </address> </leads> I need the the element name and display it along with the values in a structure. any clue? Thanks. |
|
#2
|
|||
|
|||
|
<cfsavecontent variable="theXML">
<leads> <address> <name>vvvvv</name> <city>wwww</city> <zip>11111</zip> </address> </leads> </cfsavecontent> <cfset parsedXML = xmlParse( theXML ) /> <!--- You can get the names as struct keys, and the values as the xmlText ---> <cfdump var="#parsedXML#"> <!--- Or turn it into an array of nodes and loop through it. ---> <cfdump var="#xmlSearch( parsedXML, '/leads' )#">
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
thanks a lot for the response and I'll try that out.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > getting the element name in XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|