Error Testing if XML Element Exists (with isXmlElem)
Posted on 2009-05-08
I'm parsing an XML API ... and all works great ... except on the rare occasion a specific 'branch' (for lack of correct XML terminology) fails to exist ... in which case I get this error:
Element NEWSNEWSCOLLECTIONS.NEWSNEWSCOLLECTION.NEWSNEWSARTICLES.NEWSNEWSARTICLE is undefined in a Java object of type class coldfusion.xml.XmlNodeMap referenced as ''
I'd like to TEST if element this element exists:
AND if 'collections' is TRUE ... then I can get its arraylen and do fun stuff ... else move on.
ALAS ... the test - isXmlElem reports TRUE ... when TRUE - which is great!~ but I get an ERROR when clearly it is false - instead of NO error an 'just' telling var collections = FALSE.
Does this make sense and can you help?