Hi Jerry

The '@' syntax is only for attributes, which is relevant in my example file
but not yours, which uses child elements instead of attributes.

There's a great tool called the Xpath Visualiser which you can download from

http://www.vbxml.com/xpathvisualizer/

It's very helpful for learning Xpath. You'll need IE5 on Windows and MSXML3.

Good luck

Tom

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

on 29/6/01 4:27 pm, Jerry Travioli at [EMAIL PROTECTED] wrote:

> I am using Tom Dyson's Cold Fusion custom tag 'xmlquery' and need some
> assistance with the syntax.
> 
> [source .xml file content]
> <Report>
> :
> :
> <Record>
> <state>ZZ</state>
> <prod_type>M</prod_type>
> <prod_no>1</prod_no>
> <prod_name>30 yr fixed mtg</prod_name>
> <rate>6.76</rate>
> <apr_yld>6.99</apr_yld>
> <rate_diff>S</rate_diff>
> <b1wkrate>6.76</b1wkrate>
> <b1wkapryld>6.99</b1wkapryld>
> <b1morate>6.96</b1morate>
> <b1moapryld>7.18</b1moapryld>
> <b6morate>6.85</b6morate>
> <b6moapryld>7.05</b6moapryld>
> <thisday>6/28/01</thisday>
> </Record>
> :
> :
> </Report>
> [ end ]
> 
> [cfml template code]
> <cf_xmlquery
> xmldata = "rates.xml"
> datatype = "file"
> name = "GetRates"
> xpath = "//Record[@prod_name='30 yr fixed mtg']"
> debug = "yes">
> 
> <h1>Get 30 yr Fixed</h1>
> <cfoutput query = "GetRates">
> rate: #rate#<br>
> rate_diff: #rate_diff#<br>
> </cfoutput>
> [ end ]
> 
> [error message]
> Sorry, there are no results for query 'GetRates'.
> This query will not be available to the calling template.
> cf_xmlquery C torchbox.com 2001
> [ end ]
> 
> It appear that my problem is the syntax {xpath = "//Record[@prod_name='30 yr
> fixed mtg']"}, could someone give me some pointers on the proper syntax to
> search and return from the query all of the data associated with the
> 'prod_name' "30 yr fixed mtg".
> 
> I would appreciate input and assistance.  Thank you in advance.
> 
> Best regards,
> Jerry Travioli
> 
> 
> -----------------------+
> cf-xml mailing list
> [EMAIL PROTECTED]
> http://torchbox.com/xml


-----------------------+
cf-xml mailing list
[EMAIL PROTECTED]
http://torchbox.com/xml

Reply via email to