[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Reading external XML file XSLT2.0

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

Pankaj Chaturvedi wrote:

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

<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
then if your path with /book-meta does not select anything the stylesheet might have some

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