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

Printing name of root node of an xml document

Michael Kay mhk at mhk.me.uk
Sun Jan 9 09:27:06 PST 2005


fn name
fn:root() is redundant, because fn:document() returns the root node of the
document anyway. But this is a nameless document node. You want the
outermost element node, which is a child of the document node. Try

fn:name(fn:document("x.xml")/*)

Incidentally, in most environments the fn: prefix on function calls is not
needed.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: http://xquery.com/mailman/listinfo/talk 
> [mailto:http://xquery.com/mailman/listinfo/talk] On Behalf Of padmapriya ayyagari
> Sent: 09 January 2005 07:39
> To: http://xquery.com/mailman/listinfo/talk
> Subject:  Printing name of root node of an xml document
> 
> Hello,
> 
> I want to print the name of the root node of an xml document. This
> doesn't seem to work:
> 
> fn:name(fn:root(fn:document("docs/xmark.xml")))
> 
> Can somebody please tell me what hte problem is?
> 
> Thanks,
> Padmapriya
> _______________________________________________
> http://xquery.com/mailman/listinfo/talk
> http://xquery.com/mailman/listinfo/talk
> 



PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.