Bug secondari

Gestione dei namespace -- OK

<!TARGETNS xlink 'http://www.w3.org/1999/xlink'>
<!TARGETNS h     'http://www.w3.org/HTML/1998/html4'>
<!TARGETNS       'http://www.normeinrete.it/nir/2.0/'>
dovrebbe diventare

FILE SORGENTE

<xsd:schema xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:h="http://www.w3.org/HTML/1998/html4"
    xmlns="http://www.normeinrete.it/nir/2.0/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.normeinrete.it/nir/2.0/" elementFormDefault="qualified">

   <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="./xlink.xsd"/>
   <xsd:import namespace="http://www.w3.org/HTML/1998/html4" schemaLocation="./h.xsd"/>
...
</xsd:schema>
FILE h.xsd
<xsd:schema targetNamespace="http://www.w3.org/HTML/1998/html4" elementFormDefault="qualified"
    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:h="http://www.w3.org/HTML/1998/html4"
    xmlns="http://www.normeinrete.it/nir/2.0/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:import namespace="http://www.w3.org/1999/xlink" schemaLocation="./xlink.xsd"/>
    <xsd:import namespace="http://www.normeinrete.it/nir/2.0/" schemaLocation="./nir.xsd"/>
...
</xsd:schema>
FILE xlink.xsd
<xsd:schema targetNamespace="http://www.w3.org/1999/xlink" elementFormDefault="qualified"
    xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:h="http://www.w3.org/HTML/1998/html4"
    xmlns="http://www.normeinrete.it/nir/2.0/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:import namespace="http://www.w3.org/HTML/1998/html4" schemaLocation="./h.xsd"/>
    <xsd:import namespace="http://www.normeinrete.it/nir/2.0/" schemaLocation="./nir.xsd"/>
...
</xsd:schema>

ATTENZIONE!!! In tutti i file, gli elementi, tipi complessi, tipi semplici, attributi, ecc. usati in un attributo name vanno senza prefisso, mentre usati nell'attributo ref vanno con il prefisso relativo (o nessuno se appartengono al namespace di default.

ENTITY SYSTEM e <xsd:include> -- OK

Ogni entità parametrica che è di tipo SYSTEM dovrebe diventare un include e il contenuto del file esterno così convertito dovrebbe essere inserito nel file esterno corrispondente.

Quindi:

<!ENTITY % tipiDTD SYSTEM "./tipi.dtd">
%tipiDTD;
dovrebbe diventare
<xsd:include schemaLocation="./tipi.xsd" />

Attribute Group Inutili -- OK

Attualmente il convertitore traduce ogni


<!ELEMENT x (y) >
<!ATTLIST x a CDATA #IMPLIED>


<xsd:element name="x">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="y"/>
    </xsd:sequence>
    <xsd:attributeGroup ref="x"/>
  </xsd:complexType>
</xsd:element>

<xsd:attributeGroup name="x">
  <xsd:attribute name="a" type="xsd:string"/>
</xsd:attributeGroup>

Questo deve diventare semplicemente


<xsd:element name="x">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element ref="y"/>
    </xsd:sequence>
    <xsd:attribute name="a" type="xsd:string"/>
  </xsd:complexType>
</xsd:element>

CDATA, PCDATA --- OK

Fa casino con i CDATA entro i tipi

<!ENTITY # x "CDATA" >
<!ENTITY # x "(CDATA)">

e anche con #PCDATA

<!ELEMENT x (#PCDATA) >

-- FabioVitali - 17 May 2005

Revision: r1.5 - 22 Apr 2006 - 15:31 - FabioVitali
Tesi > DppOldBugs > DppAttributeGroupInutili
Copyright © 1999-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Fabio's Wiki? Send feedback