I'm having a problem determining if an XML node exists or not. Under the node of 'Flight', there's a few children. The first child is 'Time'. The second node is 'Date'. The possible third, fourth, and fifth nodes are one of 3 possible things (if they exist): 'Scheduled', 'Actual', or 'Estimated'. Any of these last three nodes may or may not exist, and in any order.
root
Flight
Date
Time
Scheduled
Estimated
Actual
[or]
root
Flight
Date
Time
Actual
and so on
Is there a way to determine if the node Flight.Scheduled exists?
This code:
<cfset xmlnode = flightXML.xmlroot>
<cfif isDefined(xmlnode.flight.scheduled)>
produces an error on the second when the node doesn't exist.
Looks like there's probably a really ugly brute force way to do this, but it seems like there should be some sort of nodeExists() method or something. Is there? Thanks in advance for any help.
root
Flight
Date
Time
Scheduled
Estimated
Actual
[or]
root
Flight
Date
Time
Actual
and so on
Is there a way to determine if the node Flight.Scheduled exists?
This code:
<cfset xmlnode = flightXML.xmlroot>
<cfif isDefined(xmlnode.flight.scheduled)>
produces an error on the second when the node doesn't exist.
Looks like there's probably a really ugly brute force way to do this, but it seems like there should be some sort of nodeExists() method or something. Is there? Thanks in advance for any help.