Hi my XSL doesn't seem to be working with my XML. I can't seem to figure out the problem even though my code is quite simple. My XML sheet seems to transform into just raw Data when i link to the XSL spreadsheet and open the document.
My XSL
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html"/> <xsl:template match="/"> <html> <head> <title>Room Information</title> </head> <body> <h1>Room information</h1> <table border="1"> <tr bgcolor="#9acd32"> <th>TITLE</th> <th>ACCOMODATION</th> <th>COST</th> <th>LEVEL</th> <th>VIEW</th> <th>ENSUITE</th> <th>MAID_SERVICE</th> <th>ROOM_SERVICE</th> <th>LAUNDRY_SHOOT</th> <th>ROOM_IMAGE</th> <th>PAST_CUSTOMERS</th> </tr> <xsl:for-each select="ROOMS/ROOM"> <tr> <td><xsl:value-of select="TITLE"/></td> <td><xsl:value-of select="ACCOMODATION"/></td> <td><xsl:value-of select="COST"/></td> <td><xsl:value-of select="LEVEL"/></td> <td><xsl:value-of select="VIEW"/></td> <td><xsl:value-of select="ENSUITE"/></td> <td><xsl:value-of select="MAID_SERVICE"/></td> <td><xsl:value-of select="ROOM_SERVICE"/></td> <td><xsl:value-of select="LAUNDRY_SHOOT"/></td> <td><xsl:value-of select="ROOM_IMAGE"/></td> <td><xsl:value-of select="PAST_CUSTOMERS"/></td> </tr> </xsl:for-each>
This is my XML (The DTD can just be ignored)
?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="XSL/RoomsXSL.xsl"?> <!DOCTYPE ROOMS [ <!ELEMENT ROOM (TITLE+,ACCOMODATION,COST,LEVEL+,VIEW,ENSUITE,MAID_SERVICE,ROOM_SERVICE,LAUNDRY_SHOOT,ROOM_IMAGE+,PAST_CUSTOMERS+)> <!ELEMENT TITLE (#PCDATA)> <!ELEMENT ACCOMODATION (#PCDATA)> <!ELEMENT COST (#PCDATA)> <!ELEMENT LEVEL (#PCDATA)> <!ELEMENT VIEW (#PCDATA)> <!ELEMENT ENSUITE (#PCDATA)> <!ELEMENT MAID_SERVICE (#PCDATA)> <!ELEMENT ROOM_SERVICE (#PCDATA)> <!ELEMENT LAUNDRY_SHOOT (#PCDATA)> <!ELEMENT ROOM_IMAGE (#PCDATA)> <!ELEMENT PAST_CUSIMERS (#PCDATA)> <!ENTITY writer "Dylan Weiss"> <!ENTITY copyright "Horizon BnB"> ]> <ROOMS> <ROOM id="01"> <TITLE>Top Floor 1</TITLE> <ACCOMODATION>Accomodates 2 people</ACCOMODATION> <COST>$700 a week.$120 every day over a week</COST> <LEVEL>Top floor</LEVEL> <VIEW>Includes panoramic View</VIEW> <ENSUITE>Has ensuite</ENSUITE> <MAID_SERVICE>Maid service included</MAID_SERVICE> <ROOM_SERVICE>Includes room service</ROOM_SERVICE> <LAUNDRY_SHOOT>Includes laundry shoot</LAUNDRY_SHOOT> <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE> <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS> </ROOM> <ROOM id="02"> <TITLE>Bottom floor 1</TITLE> <ACCOMODATION>Accomodates 2 people</ACCOMODATION> <COST>$500 a week.$100 every day over a week</COST> <LEVEL>Ground floor</LEVEL> <VIEW>Includes a courtyard</VIEW> <ENSUITE>Has ensuite</ENSUITE> <MAID_SERVICE>Maid service included</MAID_SERVICE> <ROOM_SERVICE>Includes room service</ROOM_SERVICE> <LAUNDRY_SHOOT>No laundry shoot</LAUNDRY_SHOOT> <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE> <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS> </ROOM> <ROOM id="03"> <TITLE>Bottom floor 2</TITLE> <ACCOMODATION>Accomodates 4 people</ACCOMODATION> <COST>$800 a week.$120 every day over a week</COST> <LEVEL>Ground floor</LEVEL> <VIEW>Includes a courtyard</VIEW> <ENSUITE>Has ensuite</ENSUITE> <MAID_SERVICE>Maid service included</MAID_SERVICE> <ROOM_SERVICE>Includes room service</ROOM_SERVICE> <LAUNDRY_SHOOT>No laundry shoot</LAUNDRY_SHOOT> <ROOM_IMAGE>Images/LuxuryRoom1.jpg</ROOM_IMAGE> <PAST_CUSTOMERS>WWW.Horizon/PastCustomers.com</PAST_CUSTOMERS> </ROOM> </ROOMS>
No comments:
Post a Comment