Hola todos !!
Tengo la DTD AddressBook.dtd :
<!ELEMENT addressbook (contact)+>
<!ELEMENT contact (name,address+,city,state,zip, phone, email, web, company)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
<!ELEMENT phone (voice, fax?)>
<!ELEMENT voice (#PCDATA)>
<!ELEMENT fax (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ELEMENT web (#PCDATA)>
<!ELEMENT company (#PCDATA)>
y la pagina AddressBook.XML
<?xml version="1.0" encoding='UTF-8'?>
<?xml-stylesheet type="text/xsl" href="AddressBook.xsl"?>
<!DOCTYPE addressbook SYSTEM "AddressBook.dtd" [
<!ENTITY amp "&">
<!ENTITY apos "'">
]>
<addressbook>
<contact>
<name>Frank Raikar</name>
<address>1212 W 304th Street</address>
<city>Nueva York</city>
<state>Nueva York</state>
<zip>10011</zip>
<phone>
<voice>212-555-1212</voice>
<fax>212-555-1213</fax>
</phone>
<email>frizzo@fruity.com</email>
<web>
http://www.fruity.com/rizzo</web>
<company>Frank's Ratchet Service</company>
</contact>
<contact>
<name>Sol Ross</name>
<address>1162 E 412th Street</address>
<city>Nueva York</city>
<state>Nueva York</state>
<zip>10011</zip>
<phone>
<voice>212-555-1818</voice>
<fax>212-555-1819</fax>
</phone>
<email>srosenberg@fruity.com</email>
<web>
http://www.fruity.com/rosenberg</web>
<company>Rosenberg's Shoes & Glassess</company>
</contact>
</addressbook>
y esta es la hoja AddressBook.xsl :
<?xml version="1.0" encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl="
http://www.w3.org/TR/xsl">
<xsl:template match="/">
<html><head><title>Address Book XML Example</title></head>
<body bgcolor="#FFEEFF">
<xsl:for-each select="addressbook/contact">
<xsl:apply-templates select="name"/>
<xsl:apply-templates select="address"/>
<xsl:apply-templates select="city"/>
<xsl:apply-templates select="state"/>
<xsl:apply-templates select="zip"/>
</xsl:for-each>
</body>
</html>
</xsl:template>
<xsl:template match="name">
<h2 style="background-color: #446600;color:#FFFFFF"><xsl:value-of/></h2>
</xsl:template>
<xsl:template match="address">
<br><xsl:value-of/></br>
</xsl:template>
<xsl:template match="city">
<xsl:value-of/>
</xsl:template>
<xsl:template match="state">
<xsl:value-of/>
</xsl:template>
<xsl:template match="zip">
<br><xsl:value-of/></br>
</xsl:template>
</xsl:stylesheet>
El problema sucede cuando abro el XML con el Internet Explorer
En este caso solo me muestra el titulo de la pagina y su color de fondo mas no el
contenido XML, ¿ a que se debe esto?, ya que si le cambio a una hoja CSS si muestra
el contenido.
Espero sus prontas respuestas.
Saludos desde el rico Perú.