[xmlsec] selecting strart node from command line

Aleksey Sanin aleksey at aleksey.com
Wed Sep 24 14:07:55 PDT 2003


No, it would not! You have default namespace defined in the
first <EnvioDTE/> node. /EnvioDTE could not match
<EnvioDTE xmlns="something">! Please, please, please, read
XPath spec about nodes names. And as an illustration see
example bellow (not that the only difference between a.xml and
b.xml is the default namespace declaration

[aleksey at lsh a]$ diff -u a.xml b.xml
--- a.xml       2003-09-24 14:04:16.000000000 -0700
+++ b.xml       2003-09-24 14:04:08.000000000 -0700
@@ -3,7 +3,7 @@
 <!ATTLIST SetDTE ID ID #IMPLIED>
 <!ATTLIST Documento ID ID #IMPLIED>
 ]>
-<EnvioDTE xmlns="http://www.sii.cl/SiiDte"
+<EnvioDTE
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sii.cl/SiiDte EnvioDTE_v03.xsd" 
version="0.3">
   <SetDTE ID="SetDoc">
     <Caratula version="1.0">
[aleksey at lsh a]$ xmllint --shell a.xml
/ > xpath /EnvioDTE
Object is a Node Set :
Set contains 0 nodes:
/ >
[aleksey at lsh a]$ xmllint --shell b.xml
/ > xpath /EnvioDTE
Object is a Node Set :
Set contains 1 nodes:
1  ELEMENT EnvioDTE
    namespace xsi href=http://www.w3.org/2001/XMLSchema-instanc...
    ATTRIBUTE schemaLocation
      TEXT
        content=http://www.sii.cl/SiiDte EnvioDTE_v03.xs...
    ATTRIBUTE version
      TEXT
        content=0.3
/ >


Aleksey

>
> <EnvioDTE xmlns="http://www.sii.cl/SiiDte" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:schemaLocation="http://www.sii.cl/SiiDte EnvioDTE_v03.xsd" 
> version="0.3">
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20030924/58c8b582/attachment.htm


More information about the xmlsec mailing list