XSLT transformation cannot work out how to include namespace?

OttoSV

New Member
I am trying to create an XSLT file, and I can get it to work without including the namespace in either file, but as soon as I do include in either, it stops working. here are the examples I'm using.My XML file \[code\] <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Empire sdf</title> <artist>Bob sdf</artist> <country>2</country> <company>asdfs</company> <price>12.90</price> <year>1935</year> </cd></catalog>\[/code\]My Transform file.\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" indent="yes"/><xsl:template match="/"> <html><body><table border="1"> <tr bgcolor="#9acd32"><th>Title</th><th>Artist</th></tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table></body></html></xsl:template></xsl:stylesheet>\[/code\]My Results\[code\]<?xml version="1.0" encoding="UTF-8"?><html> <body> <table border="1"> <tr bgcolor="#9acd32"> <th>Title</th> <th>Artist</th> </tr> <tr> <td>Empire Burlesque</td> <td>Bob Dylan</td> </tr> <tr> <td>Empire sdf</td> <td>Bob sdf</td> </tr> </table> </body></html>\[/code\]No if I alter the above to this.My New XML file\[code\]<?xml version="1.0" encoding="ISO-8859-1"?><catalogxmlns="http://www.someurl.com/v3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/v3.0 ../someschema.xsl"> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> <cd> <title>Empire sdf</title> <artist>Bob sdf</artist> <country>2</country> <company>asdfs</company> <price>12.90</price> <year>1935</year> </cd></catalog>\[/code\]My New Transform file.\[code\] <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns="http://www.someurl.com/v3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/v3.0 ../someschema.xsl"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <html><body><table border="1"> <tr bgcolor="#9acd32"><th>Title</th><th>Artist</th></tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table></body></html> </xsl:template> </xsl:stylesheet>\[/code\]I now get no data out in my transformed file?Please excuse if this question is basic, I have no experience with XSLT and I'm trying to wrap my head around it currently.
 
Back
Top