Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml transformation

Status
Not open for further replies.

harmmeijer

Programmer
Mar 1, 2001
869
CN
Could anybody provide me with a full code:
I have an xml document:
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;Catalog.xsl&quot;?>
<Root >
<Products ProductName=&quot;Aniseed Syrup&quot; UnitPrice=&quot;10&quot; UnitsInStock=&quot;13&quot;/>
</Root>

I have an xsl document:
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>

<xsl:template match = '*'>
<xsl:apply-templates />
</xsl:template>
<xsl:template match = &quot;Products&quot;>
<TR>
<TD><xsl:value-of select = '@ProductName' /></TD>
<TD align=&quot;right&quot; width=&quot;75&quot;><B><xsl:value-of select = &quot;format-number(@UnitPrice, '#.00')&quot; /></B></TD>
<td align=&quot;right&quot; width=&quot;75&quot;><xsl:value-of select='@UnitsInStock' /></td>
</TR>
</xsl:template>
<xsl:template match = '/'>
<HTML>
<HEAD>
<TITLE>Northwind Traders Online Catalog</TITLE>
<STYLE>th { background-color: #CCCCCC }</STYLE>
</HEAD>
<BODY>
<TABLE border='0' width=&quot;*&quot;>
<TR><TH colspan='3'>Products</TH></TR>
<TR><TH>Product Name</TH><th>Price</th><th>Quantity On Hand</th></TR>
<xsl:apply-templates select = 'Root' />
</TABLE>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

I gues the part
xmlns:xsl=&quot;inports a namespace, I think it defignes things like &quot;template match = &quot;...&quot;&quot;
Does anybody know how to make a namespace file like this (is is java code?)?
What is the extention of a file like this?
Where can I get good sample code so I can make my own namespace file?
I do not know anything about xml, xsl so DO I MAKE SENCE and if not please explain to me.
 
Well, I got my own answer.
Here is what I pasted from the followin url:

The mandatory namespace for XSLT is &quot;Namespaces are the subject of a fair amount of confusion in XML. Despite the fact that very often namespaces appear to be URIs, they do not, in fact, refer to a resource located at that address. Instead they are simply a way of specifying a unique identifier for a known set of elements. The string &quot; is a constant that designates the elements so marked as belonging to the set of tags designated by the W3C in the 1999 XSLT Recommendation. Another string that is occasionally seen in stylesheets, &quot; indicates compliance with an earlier working draft (hence the WD) of the W3C document. This latter namespace is not compatible with the one that the W3C eventually adopted and is not supported by Netscape.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top