XSL Stylesheets

Here's what the stylesheet ch13_02.xsl might look like. In this case, I'm converting ch13_01.xml into HTML, stripping out the names of the planets, and surrounding those names with HTML <P> elements:

Listing ch13_02.xsl
 <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">     <xsl:template match="PLANETS">         <HTML>             <xsl:apply-templates/>         </HTML>     </xsl:template>     <xsl:template match="PLANET">         <P>             <xsl:value-of select="NAME"/>         </P>     </xsl:template> </xsl:stylesheet> 

Alright, we've got an XML document and the stylesheet we'll use to transform it. So how exactly do you transform the document?



Real World XML
Real World XML (2nd Edition)
ISBN: 0735712867
EAN: 2147483647
Year: 2005
Pages: 440
Authors: Steve Holzner

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net