House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / XML

ColdFusion 8 problem with xmlsearch or malformed xml ?? access 2003 exported xml

Author:
Dominic Watson
05/21/2008 02:33 PM

Two things: 1. xml is case sensitive so the 'id' in the XPath expression should be 'ID'. 2. A single slash to start an XPath expression basically says 'start at the root', so '/Media_x0020_Contacts' does not match any elements (there is no Media_x0020_Contacts element in the *root* of the document. Either use a double slash to say 'match a Media_x0020_Contacts element anywhere in the document' or write the full path to the element. So: <cfset contacts = XMLSearch(xml,'//Media_x0020_Contacts/ID') /> or <cfset contacts = XMLSearch(xml,'/dataroot/Media_x0020_Contacts/ID') /> I'd ignore the validation errors ;) HTH Dominic -- Blog it up: http://fusion.dominicwatson.co.uk


Search xml

February 12, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29