473,513 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XPath error with xsltproc/libxslt

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. 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?

thanks for your attention.

with kind regards,

Loudin
Jul 20 '05 #1
1 1967
"Loudin" <pa************@siemens.com> 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
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1822
by: Vincent Lefevre | last post by:
Hello, The XPath 1.0 recommendation says: A number represents a floating-point number. A number can have any double-precision 64-bit format IEEE 754 value . These include a special...
6
8285
by: Scott Simpson | last post by:
What is a good tool for running XPath queries on Linux? I have the O'Reilly XPath book and I'm using XPath Visualizer on Windows and that seems to work fine, but I'm looking for something on Linux....
2
2612
by: nkunapa | last post by:
Hi: Is there a way in XPATH to find the nearest node of the node in context with a certain attribute value. Here is my problem. I have the following XML and I am trying to add all the nodes with...
2
1449
by: Tjerk Wolterink | last post by:
I have xml like this: <data> <binding nodeset="/data/set1/value"/> <set1> <value name="a" value="3"/> </set1> </data>
1
1651
by: bruce | last post by:
hi... i have the following section of test code where i'm trying to get the attribute of a frame <frame src="...."> i'm trying to print/get the src value. the xpath query that i have...
14
1981
by: Mat| | last post by:
Hello :-) I am learning XPath, and I am trying to get child nodes of a node whose names do *not* match a given string, e.g : <dummy> <example> <title>Example 1</title> <body>this is an...
1
2262
by: sobczyk.wojciech | last post by:
I have XML: <xml xmlns="http://abc"> <A t="ttt"></A> <B xmlns="http://qwerty"><X>aaaa</X></B> </xml> How to point node "B" with XPath without any changes in this xml?
1
2673
by: Arndt Jonasson | last post by:
The way I read the XPath 1.0 specification, queries like "//*/ text()/.." and "//*/child::text()" should be valid. xmllint seems to agree with me, but xsltproc gives syntax errors for those...
2
3026
by: A. W. Dunstan | last post by:
I'm trying to figure out how XPath expressions work, and how I can use them to extract data into a particular format. I can extract the data I want using an XPath expression, but not with an XSLT...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3234
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.