utilizzando un documento in DTD ho fatto la seguente:Entità DTD vs XML-Schema Elementi
file.xsl:
<!DOCTYPE xsl:stylesheet[
<!ENTITY red "rgb(255,0,0)">
]>
<xsl:stylesheet>
[...]
<xsl:attribute name="color">&red;</xsl:attribute>
[...]
</xsl:stylesheet>
volevo cambiare tutto per XML-Schema. Così ho provato:
file.xsd:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="red" type="xs:token" fixed="rgb(255,0,0)" />
</xsd:schema>
file.xsl:
<xsl:stylesheet
xmlns:defs="http://www.w3.org/2001/XMLSchema-instance"
defs:noNamespaceSchemaLocation="file.xsd">
[...]
<xsl:attribute name="color"><defs:red/></xsl:attribute>
[...]
</xsl:stylesheet>
Ora l'analisi del file tramite Xalan rosso non è tradotto, come nella versione DTD. Dov'è il mio errore? I file dello schema non vengono letti durante il processo di analisi?
Acclamazioni
Gen
+1 per una domanda che è utile a me – KLE