kanonizace XML

Oto Buchta tapik na buchtovi.cz
Sobota Únor 6 12:59:58 CET 2010


Ve specce se pravi:
"Eliminates namespace declarations from elements where they may not
belong according to the application's content model, thereby
simplifying the task of reattaching a document type declaration to a
canonical form."

Eliminovat je tedy mozno podle meho nazoru pouze ty, ktere se
duplikuji (viz priklad 3.3 Start and End Tags), protoze jinak by to
mohlo narusil application's content model. (nezapomenme, ze vnitrni
kanonizaci muze prochazet i DOM v prubehu vytvareni a potom bychom
tedy nedafinovali namespace ns3 na ns2:C, ale protoze neexistuje zadne
ns3:E jako potomek, tak by byl namespace okamzite vykanonizovan.

Z toho bych usuzoval, ze spravne je jenom

<ns2:C xmlns:ns1="ns1.uri" xmlns:ns2="ns2.uri" xmlns:ns3="ns3.uri">
    <ns2:D></ns2:D>
</ns2:C>

Nezapomenout tedy na rozbaleni tagu!

2010/2/5 Lucie Rút Bittnerová <lucie na mathan.cz>:
> Dobry den,
>
> mam kanonizaci http://www.w3.org/TR/2001/REC-xml-c14n-20010315 a spustim ji
> na nasledujici dokument na element C:
>
> <ns1:A xmlns:ns1="ns1.uri" xmlns:ns2="ns2.uri" xmlns:ns3="ns3.uri">
>   <ns1:B>
>      <ns3:E />
>   </ns1:B>
>   <ns2:C>
>      <ns2:D />
>   </ns2:C>
> </ns1:A>
>
> Otazkou je, ktery vystup kanonizace je spravne:
>
> 1)
>  <ns2:C xmlns:ns1="ns1.uri" xmlns:ns2="ns2.uri" xmlns:ns3="ns3.uri">
>      <ns2:D />
>   </ns2:C>
>
> 2)
>  <ns2:C xmlns:ns1="ns1.uri" xmlns:ns2="ns2.uri">
>      <ns2:D />
>  </ns2:C>
>
> Osobne si myslim, ze spis 1), ale nejsem si tim uplne jista.
> Lucie
>

-- 
Oto 'tapik' Buchta, tapik na buchtovi.cz, http://tapikuv.blogspot.com



Další informace o konferenci Konference