Using the browser to transform an XML document

janilol

New Member
I have XML data and am trying to use XSL to format the data. I am following some tutorials. When previewing the XML in Internet Explorer the data is on one line; when previewing with Firefox I get the error message:\[quote\] Error loading stylesheet: Parsing an XSLT stylesheet failed.\[/quote\]Here the XML: \[code\] <?xml version= "1.0"?><?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/13750171/style.xsl"?> <countries> <country> <countryname>United States</countryname> </country> <country> <countryname>United Kingdom</countryname> </country> <country> <countryname>Deutschland</countryname> </country> <country> <countryname>Osterreich</countryname> </country> <country> <countryname>Espana</countryname> </country> <country> <countryname>France</countryname> </country> <country> <countryname>Italia</countryname> </country> <country> <countryname>China</countryname> </country> <country> <countryname>Hong Kong</countryname> </country> <country> <countryname>Japan</countryname> </country> <country> <countryname>Singapore</countryname> </country> <country> <countryname>Taiwan</countryname> </country> <country> <countryname>Malaysia</countryname> </country> </countries>\[/code\]Here is the XSL:\[code\] <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/countries"><html><body> <xsl:for-each select="country" <xsl:value-of select="countryname"/><br/> </xsl:for-each></body></html></xsl:template></xsl:stylsheet>\[/code\]Why does the browser not display the XML document as described by the XSL template?Thank you!
 
Back
Top