I keep getting this XML file does not appear to have any style information associated with it.



3 seperate files DTD, XML, XSL. Each Named PhotoOrders. I keep getting error no style info. But I included it. I have been using Chrome, IE, and Firefox. All Same error I tried using validator still no help.


DTD File:



<!-- PhotoOrders.dtd -->
<!-- DTD document for PhotoOrders.xml -->

<!ELEMENT PhotoOrders (outlet+, customer*)>
<!ELEMENT outlet (name, address, city, state, zip, phone)>

<!ELEMENT name (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT time (#PCDATA)>

<!ELEMENT customer (firstname, lastname, address, city, state, zip, phone, email, orders+)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
<!ELEMENT phone (#PCDATA)>
<!ELEMENT email (#PCDATA)>
<!ATTLIST customer firstname CDATA #IMPLIED>
<!ATTLIST customer lastname CDATA #REQUIRED>
<!ATTLIST customer address CDATA #IMPLIED>
<!ATTLIST customer city CDATA #IMPLIED>
<!ATTLIST customer state CDATA #IMPLIED>
<!ATTLIST customer zip CDATA #IMPLIED>
<!ATTLIST customer phone CDATA #REQUIRED>
<!ATTLIST customer email CDATA #IMPLIED>

<!ELEMENT orders (typeofmedium, numofcopies, sizeofphoto, typeoffinishing, urgency)>

<!ELEMENT typeofmedium EMPTY>
<!ATTLIST typeofmedium medium (Flash_Drive | CD | DVD | Memory_Card ) "CD">

<!ELEMENT numofcopies EMPTY>
<!ATTLIST numofcopies copies (1 | 2 | 3 | 4) "1">

<!ELEMENT sizeofphoto EMPTY>
<!ATTLIST sizeofphoto size (4x6 | 8x11 | 5x12 | 10x14) "4X6">

<!ELEMENT typeoffinishing EMPTY>
<!ATTLIST typeoffinishing finishing (Matte | Glossy | Black-White) "Matte">

<!ELEMENT urgency EMPTY>
<!ATTLIST urgency urgency (Normal | Urgent) "Normal">


XML file:



<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type ="text/xsl" href="PhotoOrders.xsl"?>

<!DOCTYPE PhotoOrders SYSTEM "PhotoOrders.dtd">

<PhotoOrders>
<outlet>
<name>Rite Aid #1021</name>
<address>123 Main Street</address>
<city>Fairport</city>
<state>NY</state>
<zip>14450</zip>
<phone>(585)223-9999</phone>
<date>November 4,2013</date>/<time>1700</time>
</outlet>
<customer>
<firstname>John Doe</firstname>
<address>172 Main Street</address>
<city>Fairport</city>
<state>NY</state>
<zip>14450</zip>
<phone>(585)223-0000</phone>
<orders type="first">
<typeofmedium medium = "Flash_Drive" />
<numofcopies copies = "2" />
<sizeofphoto size = "4x6" />
<typeoffinishing finishing = "Matte" />
<urgency urgency = "Normal" />
</orders>
<orders type="second">
<typeofmedium medium = "CD" />
<numofcopies copies = "3" />
<sizeofphoto size = "8x11" />
<typeoffinishing finishing = "Black-White" />
<urgency urgency = "Normal" />
</orders>
</customer>
<customer>
<firstname>Jane Public</firstname>
<lastname></lastname>
<address></address>
<city></city>
<state></state>
<zip></zip>
<phone>(585)555-0909</phone>
<email></email>
<orders type="first">
<typeofmedium medium = "Memory_Card" />
<numofcopies copies = "1" />
<sizeofphoto size = "10x14" />
<typeoffinishing finishing = "Matte" />
<urgency urgency = "Urgent" />
</orders>
<orders type="second">
<typeofmedium medium = "CD" />
<numofcopies copies = "2" />
<sizeofphoto size = "8x11" />
<typeoffinishing finishing = "Black-White" />
<urgency urgency = "Urgent" />
</orders>
</customer>
</PhotoOrders>


XSL file:



<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl = "http://ift.tt/tCZ8VR">
<xsl:output method="html" encoding="utf-8" indent="yes" />
<xsl:template match = "/">
<html>
<head></head>
<body>
<xsl:for-each select = "PhotoOrders/outlet">
<P ALIGN = "CENTER">
<BR/><xsl:value-of select = "name"/>
<BR/><xsl:value-of select = "address"/>
<BR/><xsl:value-of select = "city"/>,
<xsl:value-of select = "state"/>
<xsl:value-of select = "zip"/>
<BR/><xsl:value-of select = "phone"/>
<BR/><xsl:value-of select = "date"/> /
<xsl:value-of select = "time"/>
</P>
</xsl:for-each>

<xsl:for-each select = "PhotoOrders/customer">
<P ALIGN = "LEFT">
<BR/><b>Customer Name:</b>
<BR/><xsl:value-of select = "firstname"/>
<xsl:value-of select = "lastname"/>
<BR/><xsl:value-of select = "address"/>
<BR/><xsl:value-of select = "city"/>
<xsl:value-of select = "state"/>
<xsl:value-of select = "zip"/>
<BR/><xsl:value-of select = "phone"/>
<BR/><xsl:value-of select = "email"/>
</P>
</xsl:for-each>
<xsl:for-each select = "customer/orders[@type = 'first']">
<P ALIGN = "CENTER">
<BR/>
<pre>
<b>Photo Medium</b> <b>Copies</b> <b>Size</b> <b>Finishing</b> <b>Urgency</b>
<xsl:value-of select = "typeofmedium"/> <xsl:value-of select = "numofcopies"/> <xsl:value-of select = "sizeofphoto"/> <xsl:value-of select = "typeoffinishing"/> <xsl:value-of select = "urgency"/>
</pre>
</P>
</xsl:for-each>
<xsl:for-each select = "customer/orders[@type = 'second']">
<P ALIGN = "CENTER">
<pre>
<xsl:value-of select = "typeofmedium"/> <xsl:value-of select = "numofcopies"/> <xsl:value-of select = "sizeofphoto"/> <xsl:value-of select = "typeoffinishing"/> <xsl:value-of select = "urgency"/>
</pre>
</P>
</xsl:for-each>
</body>
</html>

</xsl:template>
</xsl:stylesheet>

No comments:

Post a Comment