#149013 Add namespace registration mecanism in xmllint --shell.

Package:
libxml2
Source:
libxml2
Description:
GNOME XML library
Submitter:
"Antonio Fiol"
Date:
2014-11-11 15:03:09 UTC
Severity:
wishlist
#149013#5
Date:
2002-06-04 13:22:28 UTC
From:
To:
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

#149013#10
Date:
2004-01-30 08:08:08 UTC
From:
To:
severity 149013 wishlist
retitle 149013 Add namespace registration mecanism in xmllint --shell.
tag 149013 upstream
thanks

You receive this mail because you have submitted a bug about xmllint --shell
not supporting namespaces.
This issue has been recently discussed upstream, and may be hopefully solved
soon.
In the meanwhile, I tag the bug as wishlist, since, well, the non support of
namespaces in xmllint --shell was a feature, not a bug.

Regards

Mike

#149013#19
Date:
2004-01-30 08:08:08 UTC
From:
To:
severity 149013 wishlist
retitle 149013 Add namespace registration mecanism in xmllint --shell.
tag 149013 upstream
thanks

You receive this mail because you have submitted a bug about xmllint --shell
not supporting namespaces.
This issue has been recently discussed upstream, and may be hopefully solved
soon.
In the meanwhile, I tag the bug as wishlist, since, well, the non support of
namespaces in xmllint --shell was a feature, not a bug.

Regards

Mike

#149013#24
Date:
2014-11-11 14:55:38 UTC
From:
To:
This feature was added quite some time ago. The debug shell learned the
`setns` command in 2004 and the `setrootns` command in 2005. See

https://git.gnome.org/browse/libxml2/commit/?id=bbaa997a06eef7198af749649a3aac4fc6cff0c5
https://git.gnome.org/browse/libxml2/commit/?id=20887eef62c93f1b45ec40f4f4b564730a0ba0e8

Nick