Re: Request for clarification on Canonical XML

At 00:57 03/07/25 -0400, Rich Salz wrote:
> > In particular the problem
> > of namespaces that are used but not so visibly so, seems to be a reasonable
> > argument for using c14n rather than exc-c14n).
>
>Not sure what this could mean - you mean something
>like a qname attribute value?  Oh.  I suppose you
>could work around that by adding the prefix to the
>inclusives list, but I see your point.

In a very specific application, the 'inclusives list' works well.
If you want to be general, it doesn't work well.

One idea I recently thought about was to define an attribute
of the form prefix:dummy to make a prefix and the
associated namespace visible with exc-c14n.

To take an example from the XML Schema Primer
(http://www.w3.org/TR/xmlschema-0/#UseDerivInInstDocs)
(simplified):

<ipo:purchaseOrder
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:ipo="http://www.example.com/IPO">

     <shipTo exportCode="1" xsi:type="ipo:UKAddress">
         <name>Helen Zoe</name>
         <street>47 Eden Street</street>
         <city>Cambridge</city>
         <postcode>CB1 1JR</postcode>
     </shipTo>
</ipo:purchaseOrder>

If we take the <shipTo> element and canonicalize it, the
Qname attribute value "ipo:UKAddress" will be invisible,
and the 'ipo' prefix will become orphaned.

The solution would be to write something like:

<ipo:purchaseOrder
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:ipo="http://www.example.com/IPO">

     <shipTo exportCode="1" ipo:dummy="" xsi:type="ipo:UKAddress">
         <name>Helen Zoe</name>
         <street>47 Eden Street</street>
         <city>Cambridge</city>
         <postcode>CB1 1JR</postcode>
     </shipTo>
</ipo:purchaseOrder>


It would be nice if there would be an uniform convention for the
name of the 'dummy' element, but this can't be established throughout
because there are no reserved attribute names (only the prefix is
not allowed to start with 'x' 'm' 'l'; the actual attribute name
can start with anything). But at least this can be done on a case-
by-case basis.

Regards,   Martin.

Received on Friday, 25 July 2003 16:33:25 UTC