Maybe it's me who is wrong. Please shed some light on this:
I am trying to use xmllint --shell to navigate in a XSLT file (say
some.xsl).
I use it as:
xmllint --shell some.xsl
My XSLT file has the following structure (... used for meaning more info is
there, but is not relevant to this bug/feature):
<xsl:stylesheet ... xmlns:xsl="...">
<xsl:import ... />
<xsl:output ... />
<xsl:template ...>...</xsl:template>
</xsl:stylesheet>
Here is a sample session:
---------------------------
1: / > ls
2: -an 3 stylesheet
3: / > dir
4: DOCUMENT
5: version=1.0
6: encoding=iso-8859-1
7: URL=mesures.xsl
8: standalone=true
9: namespace xml href=http://www.w3.org/XML/1998/namespace
10: / > cd xsl:stylesheet
11: Error Undefined namespace prefix
12: xsl:stylesheet
13: ^
14: xmlXPathEval: evaluation failed
15: xsl:stylesheet: no such node
16: / > cd *
17: stylesheet > dir
18: ELEMENT xsl:stylesheet
19: namespace xsl href=http://www.w3.org/1999/XSL/Transform
20: ATTRIBUTE version
21: TEXT
22: content=1.0
23: stylesheet > ls
24: -a- 0 import
25: -a- 0 output
26: -a- 1 template
27: stylesheet > cd template
28: template is a 0 Node Set
29: stylesheet > cd xsl:template
30: Error Undefined namespace prefix
31: xsl:template
32: ^
33: xmlXPathEval: evaluation failed
34: xsl:template: no such node
35: stylesheet > cd *[3]
36: template > bye
--------------------------
As you see on lines 18 and 19, the element is xsl:stylesheet, of the xsl
namespace.
Why doesn't it recognize the namespace. Am I doing something wrong?
What I tried first, and what I wanted to use xmllint for is:
/ > xpath //xsl:apply-templates
Which, of course, does not work either.
Thank you for looking into it.
Antonio Fiol