[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Hi Steve,
If you did not set the XPath default namespace then any name test without a prefix will select elements from no namespace. You need either a prefix mapped to the http://dita4publishers.org/enumerables namespace and then use that to qualify the title name test or declare the XPath default namespace to pint to the http://dita4publishers.org/enumerables namespace, see an example below:
Note that the XPath default namespace is inheritable, similar with the namespace declarations, if you declare it on an element, it applies on the whole tree rooted on that element, unless of course it is not redefined on some inner element.
On 5/11/11 9:58 AM, Steve Fogel wrote:
Re: [xsl] Simple xpath expression---child node of variable---stumping me
Subject: Re: [xsl] Simple xpath expression---child node of variable---stumping me From: George Cristian Bina <george@xxxxxxxxxxxxx> Date: Wed, 11 May 2011 10:24:01 +0300 |
Hi Steve,
If you did not set the XPath default namespace then any name test without a prefix will select elements from no namespace. You need either a prefix mapped to the http://dita4publishers.org/enumerables namespace and then use that to qualify the title name test or declare the XPath default namespace to pint to the http://dita4publishers.org/enumerables namespace, see an example below:
<xsl:value-of select="$enumFig/title" xpath-default-namespace="http://dita4publishers.org/enumerables" />
Note that the XPath default namespace is inheritable, similar with the namespace declarations, if you declare it on an element, it applies on the whole tree rooted on that element, unless of course it is not redefined on some inner element.
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 5/11/11 9:58 AM, Steve Fogel wrote:
Hi, all...
This seems like a no-brainer, but it's not producing the desired results.
If $enumFig is declared as:
<xsl:variable name="enumFig" as="element()+" select="$enumerables//*[@sourceId=$figId]" />
and in my debugging<xsl:message> output, $enumfig is:
<fig xmlns="http://dita4publishers.org/enumerables" sourceId="topicidfig-38-24-22" id="UNAMECommandOutput-FF8FD85A" class="- topic/fig "><title>UNAME Command Output</title></fig>
and<xsl:sequence select="$enumFig/*" /> returns this:
<title xmlns="http://dita4publishers.org/enumerables">UNAME Command Output</title>
then why does the following return an empty sequence?
<xsl:value-of select="$enumFig/title" />
I'm stumped!!
Thx
Steve
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Simple xpath expression--, Wolfgang Laun | Thread | [xsl] html5 with xQuery, Leo Studer |
Re: [xsl] Simple xpath expression--, Wolfgang Laun | Date | [xsl] Re: How to add a attribute of, Sanjaya Liyanage |
Month |
Keywords