I have a simple XML file: customer.xml
<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="web.xsl"?> <purple> <customer cid="1"> <fname>John</fname> <lname>Klingard</lname> <apt>27</apt> <street>30th Winstonhut St.</street> <pobox>199183</pobox> </customer> This is my XSL file: web.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"> <xsl:template match="/"> <html> <head> <title>Customer</title> </head> <body> <xsl:for-each select="//customer[@cid='1']"> <xsl:value-of select="fname"/> <br/> <xsl:value-of select="lname"/> <br/> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> The problem is that there is no output on the browser from the query. I am using Google Chrome. I suspect that there might be something wrong with the XPath query itself. But, am I missing anything else?
Thanks!
No comments:
Post a Comment