[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

step expression

Jonathan Robie jonathan.robie at datadirect.com
Mon Apr 17 14:24:08 PDT 2006

step to expression
Tim Finney wrote:
> This kind of expression is allowed:
> doc($doc_name)/node_seq_1/node_seq_2
> I would like to be able to do this:
> let
>   $step1 := some_fn($name_space1, $element_name_1)
>   $step2 := some_fn($name_space2, $element_name_2)
> return
>   doc($doc_name)/$step1/$step2
> Can this be done?

Hi Tim,

You do this using the name() function:

let $doc_name := "invoice.xml"
let $step1 := "invoice"
let $step2 := "customer"
 doc($doc_name)/*[name() eq $step1]/*[name() eq $step2]

Hope this helps!


Read my Blog: http://blogs.datadirect.com/jonathan_robie/
Learn XQuery: http://media.datadirect.com/download/docs/ddxquery/tutorial_query.html
Learn XQJ (the JDBC for XQuery): http://www.datadirect.com/developer/xquery/topics/xqj_tutorial/
Get DataDirect XQuery: http://www.datadirect.com/products/xquery/


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.