Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XPath error with xsltproc/libxslt [Thread Next] Re: XPath error with xsltproc/libxsltTo: NULL Date: 7/1/2005 9:28:00 AM "Loudin" <patrick.loudin@s...> writes: > Hello, > > I`ve got Problems with Xpath and xsltproc/libxslt. > > I have got a variable with tags in my Style sheet and later in the same > Style sheet i want to work with this tags using a <xsl:for-each>. Here is a > example: > > > > <xsl:variable name="posinfo"> > > <pos tagname="dummy1" postypes="123"/> > > <pos tagname="dummy2" postypes="456"/> > > <pos tagname="dummy3" postypes="789"/> > > </xsl:variable> > > > > <xsl:for-each select="$posinfo/pos"> > > <POS>...</POS> > > </xsl:for-each> > > I am using saxon and with saxon the for-each works correctly. Presumably you are using saxon 8 (which implements xslt2) or specifying version="1.1" on xsl:stylesheet with saxon 6. (XSLT 1.1 never existed but saxon 6 implements a draft of it. This draft and the draft xslt2 implemented by saxon8 both allow this syntax. > But I want to > change to xsltproc, because it ist faster. But with xsltproc I am getting > the message: "XPath error : Invalide type". Does somebody know, how i can > fix this error? > I believe xsltproc has a node-set extension function, in which case you need to convert the result tree fragment into a node set, something like <xsl:for-each select="x:node-set($posinfo)/pos"> whateverr xmlns:x="whatever xsltproc's extension namespace is" > thanks for your attention. > > with kind regards, > > Loudin To do it without extension functions, put <x> <pos tagname="dummy1" postypes="123"/> <pos tagname="dummy2" postypes="456"/> <pos tagname="dummy3" postypes="789"/> </x> in foo.xml and use <xsl:for-each select="document('foo.xml')/x/pos"> David | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
