Hi Allen

The XMLQuery tag isn't really designed to handle complex XML data with
deeply nested elements - it works better with row-oriented XML like this:

<members>
<memberinfo id= "001" namefirst = "Allen" namesecond = "Norris" />
<memberinfo id= "002" namefirst = "Tom" namesecond = "Dyson" />
</members>

With XML documents nesting elements deeper than two levels you'd be better
off using the XMLDatasource2Struct tag:

http://torchbox.com/xml/XMLTagDocs/TagReference/XMLDatasource2Struct.htm

Having said that, you could get to the memberInfo data by modifying your
XPath:

<CF_XMLQuery Datasource="MyDatasource" Name="info" TYPE="XPath">
    /[EMAIL PROTECTED]/MemberInfo
</CF_XMLQuery>

<CFOUTPUT Query="info">
    -#MemberInfo_NameFirst#-<br />
</CFOUTPUT>

Hope this helps

Tom

> I'm new to using this so trying to figure out how to display my information
> well.
> 
> Here's the xml file
> 
> -----------------------------
> <?xml version="1.0" ?>
> 
> - <Member ID="001">
> - <MemberInfo>
> <MemberId>001</MemberId>
> <Status>A</Status>
> <NameFirst>ALLEN</NameFirst>
> <NameSecond>NORRIS</NameSecond>
> - <Address>
> <AddressLine>Home</AddressLine>
> <AddressLine>1621 FINCASTLE ROAD</AddressLine>
> <AddressLine>LEXINGTON, KY</AddressLine>
> <AddressLine>40502</AddressLine>
> </Address>
> </MemberInfo>
> </Member>
> 
> -------------------------------
> 
> 
> <!--- cfm code --->
> <CF_XMLQuery Datasource="MyDatasource" Name="personalInformation"
> TYPE="XPath">
> //[EMAIL PROTECTED]
> </CF_XMLQuery>
> 
> <CFOUTPUT Query="personalInformation">
> -#Member_MemberInfo_NameFirst#-<br />
> </CFOUTPUT>
> <!--- end code --->
> 
> I'm trying to figure out how to display the First name and such.  I can
> display everything in it so the query works but it just prints out a long
> line.
> 
> However the Member_MemberInfo_NameFirst doesn't work.  I get the standard
> "Error resolving parameter MEMBER_MEMBERINFO_NAMEFIRST".
> 
> Can someone give me an idea on what I'm doing wrong.
> 
> Thanks,
> 
> Allen Norris

-----------------+
tom dyson
t: +44 (0)1608 811870
m: +44 (0)7958 752657
http://torchbox.com


-----------------------+
cf-xml mailing list
http://torchbox.com/xml/list.cfm

Reply via email to