[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Reading external XML file XSLT2.0

Subject: Re: Reading external XML file XSLT2.0
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 08 May 2013 14:45:21 +0200
Re:  Reading external XML file XSLT2.0
Pankaj Chaturvedi wrote:

Yes but only you know if that is where the file is.

Do
<xsl:message select="'extNode: ',$extNode"/>

and see if it outputs anything you should see the full file contents.

Yeah I can see the its shows full content of XML file. Then why I am able to print values using:

<xsl:value-of select="$extNode/book-meta/book/@author"/>

Are you able or are you not able to do that?
If $extNode is a document node which you think has a root element named "book-meta" but your path does not select anything than that is usually due to namespaces complicating things.
So either the XML has e.g.
<book-meta xmlns="http://example.com/ns">...</book-meta>
and your path with "book-meta" then does not work as it does not take the namespace into account or the XML is really
<book-meta>...</book-meta>
then if your path with /book-meta does not select anything the stylesheet might have some
xpath-default-namespace
defined.


Or for that matter

<xsl:value-of select="document($extNode)/book-meta/book/@author"/>

Well if you already have a document node then calling the "document" function on it usually does not make sense, unless the string value of the document node contains the URL to another document you want to load.


Current Thread

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.