You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by "raul-info@r-bg.com" <ra...@r-bg.com> on 2004/04/25 13:09:35 UTC

c14n Inclusive question.

I'm rewriting the inclusive canonicalization and i see same weirds thing 
in the test vector:

/data/interop/c14n/Y4/c14n-1.txt:

<bar:Something xmlns:bar="http://example.org/bar" xml:lang="en-ie">
     <foo:Something xmlns:foo="http://example.org/foo">
        <bar:Something xmlns:bar="http://example.org/bar">
           <foo:Something xmlns:foo="http://example.org/foo">
             <baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
           </foo:Something>
        </bar:Something>
     </foo:Something>
  </bar:Something>



Is valid and this one not:

<bar:Something xmlns:bar="http://example.org/bar" xml:lang="en-ie">
     <foo:Something xmlns:foo="http://example.org/foo">
        <bar:Something>
           <foo:Something>
             <baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
           </foo:Something>
        </bar:Something>
     </foo:Something>
  </bar:Something>

Why is needed to redeclare the xmlns:foo & xmlns:bar in the same prefixes?
I have readed the spec and doesn't see why, I'm getting mad about it.

Thanks in advance.


Re: c14n Inclusive question.

Posted by Berin Lautenbach <be...@wingsofhermes.org>.
raul-info@r-bg.com wrote:

> Other question when a xmlns attribute is selected with the xpath but the
> parent isn´t(i.e you just output xmlns:X="") & a child needs to render the
> same xmlns. It is taken at renderedi.e.
> <!-- only the attribute is selected -->
> <A xmlns:d="ddd">
>   <!-- everything is seleceted -->
>   <b xmlns:d="ddd">
>   </b>
> </A>
> 
> the output is:
> 
> xmlns:d="ddd"
> <b xmlns:d="ddd"></b>
> 
> or:
> 
> xmlns:d="ddd"
> <b></b>

 From memory, the latter.  The parent element has a xmlns attribute that 
is in the nodeset (doesn't matter whether or not the element itself is 
in the nodeset).

Cheers,
	Berin

Re: c14n Inclusive question.

Posted by ra...@r-bg.com.
> Hi Raul,
>
> here's an attempt to help you further:
>
> from the spec:
> Namespace Nodes- A namespace node N is ignored if the nearest ancestor
> element of the node's parent element that is in the node-set has a
> namespace node in the node-set with the same local name and value as N.
> Otherwise, process the namespace node N in the same way as an attribute
> node, except assign the local name xmlns to the default namespace node
> if it exists (in XPath, the default namespace node has an empty URI and
> local name).
>
> Now, if I apply that to the xmlns:bar="http://example.org/bar"
> namespace node (N) belonging to the element in the third line:
>
Thanks a lot Karel, yesterday night I realize it, but thank you very much.
The problem is that when you c14n a tree it "seems" you don´t have to take
this on account(Can anyone comfirm this?). And as i unifiying the handling
of attributes in a (sub)tree c14n & xpath I found this problem.
Other question when a xmlns attribute is selected with the xpath but the
parent isn´t(i.e you just output xmlns:X="") & a child needs to render the
same xmlns. It is taken at renderedi.e.
<!-- only the attribute is selected -->
<A xmlns:d="ddd">
  <!-- everything is seleceted -->
  <b xmlns:d="ddd">
  </b>
</A>

the output is:

xmlns:d="ddd"
<b xmlns:d="ddd"></b>

or:

xmlns:d="ddd"
<b></b>



regards,



Re: c14n Inclusive question.

Posted by Karel Wouters <kw...@esat.kuleuven.ac.be>.
Hi Raul,

here's an attempt to help you further:

from the spec:
Namespace Nodes- A namespace node N is ignored if the nearest ancestor
element of the node's parent element that is in the node-set has a
namespace node in the node-set with the same local name and value as N.
Otherwise, process the namespace node N in the same way as an attribute
node, except assign the local name xmlns to the default namespace node if
it exists (in XPath, the default namespace node has an empty URI and local
name).

Now, if I apply that to the xmlns:bar="http://example.org/bar" namespace
node (N) belonging to the element in the third line:

N's parent element that is in the node-set:
bar:Something

bar:Something's nearest ancestor:
<foo:Something xmlns:foo="http://example.org/foo">

this node doesn't have a namespace node
xmlns:bar="http://example.org/bar", so you cannot delete N.


if somebody on the list could double-check this, I would feel more
comfortable :)

Karel.


------------------------------------------------------------------------
Katholieke Universiteit Leuven                      tel. +32 16 32 96 17
Dept. Electrical Engineering-ESAT / COSIC
Kasteelpark Arenberg 10, B-3001 Leuven-Heverlee, BELGIUM

                 http://www.esat.kuleuven.ac.be/cosic
------------------------------------------------------------------------



On Sun, 25 Apr 2004, raul-info@r-bg.com wrote:

> I'm rewriting the inclusive canonicalization and i see same weirds thing
> in the test vector:
>
> /data/interop/c14n/Y4/c14n-1.txt:
>
> <bar:Something xmlns:bar="http://example.org/bar" xml:lang="en-ie">
>      <foo:Something xmlns:foo="http://example.org/foo">
>         <bar:Something xmlns:bar="http://example.org/bar">
>            <foo:Something xmlns:foo="http://example.org/foo">
>              <baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
>            </foo:Something>
>         </bar:Something>
>      </foo:Something>
>   </bar:Something>
>
>
>
> Is valid and this one not:
>
> <bar:Something xmlns:bar="http://example.org/bar" xml:lang="en-ie">
>      <foo:Something xmlns:foo="http://example.org/foo">
>         <bar:Something>
>            <foo:Something>
>              <baz:Something xmlns:baz="http://example.org/baz"></baz:Something>
>            </foo:Something>
>         </bar:Something>
>      </foo:Something>
>   </bar:Something>
>
> Why is needed to redeclare the xmlns:foo & xmlns:bar in the same prefixes?
> I have readed the spec and doesn't see why, I'm getting mad about it.
>
> Thanks in advance.
>