Subject: RE: [xsl] xslt transformation did not create any output From: Roelof Wobben <rwobben@xxxxxxxxxxx> Date: Fri, 9 Dec 2011 16:43:24 +0000 |
Oke, What I try to achieve is to break a big xslt file into pieces. So What I want to achieve is that the something matches to root. Then I need a piece which contains the piece which holds the head section of the html file. And so on and so on. But appearently Im on the wrong track. If someone can point me to the right track im a very happy men. In the mean time I will try to find the answer with Google how I can translate a html file into a xslt file which contains parts and not one very big file. Roelof ---------------------------------------- > From: bbosgoed@xxxxxxx > Date: Fri, 9 Dec 2011 16:10:35 +0100 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] xslt transformation did not create any output > > > > > <xsl:template match="/" > > > <xsl:apply-templates select="head"/> > > <xsl:apply-templates select="content"/> > > <xsl:apply-templates select="bottom" /> > > </xsl:template> > > First you match the root element, thats ok. > But the 3 apply-templates select are doing nothing because > > a) there is no corresponding <xsl:template match="head">...</xsl:template> > <xsl:template match="content">...</xsl:template> > <xsl:template match="bottem">...</xsl:template> > > b) the elements "head", "content" bottom" do not exist in the xml input file, so there is nothing to process. > > > > Op 9 dec 2011, om 14:09 heeft Roelof Wobben het volgende geschreven: > > > > > > > > > Hello, > > > > > > > > I did not skip that part, > > > > I think I get confused during the way. > > > > > > > > But according to this page : http://www.w3schools.com/xsl/xsl_apply_templates.asp > > > > > > > > I have to be this way : > > > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > > > <xsl:template match="/" > > > <xsl:apply-templates select="head"/> > > <xsl:apply-templates select="content"/> > > <xsl:apply-templates select="bottom" /> > > </xsl:template> > > > > <xsl:template match="head" > > > <head> > > <title> > > <xsl:value-of select="$website-name"/> - <xsl:value-of select="$page-title"/> > > </title> > > <link rel="stylesheet" type="text/css" href="{$workspace}/assets/css/style.css"/> > > <link rel="alternate" type="application/rss+xml" title="Notepad Chaos RSS Feed" href="http://www.notepadchaos.com/feed/" /> > > <link rel="pingback" href="http://www.notepadchaos.com/xmlrpc.php" /> > > <link rel="alternate" type="application/rss+xml" title="Notepad Chaos Feed" href="http://www.notepadchaos.com/feed/" /> > > <link rel="alternate" type="application/rss+xml" title="Notepad Chaos Comments Feed" href="http://www.notepadchaos.com/comments/feed/" /> > > <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.notepadchaos.com/xmlrpc.php?rsd" /> > > <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://www.notepadchaos.com/wp-includes/wlwmanifest.xml"/> > > <link rel='index' title='Notepad Chaos' href='http://www.notepadchaos.com/' /> > > </head> > > </xsl:template> > > > > > > > > But still the same error. > > > > > > > > Roelof > > > > > > > > > > ---------------------------------------- > >> Date: Fri, 9 Dec 2011 12:59:48 +0000 > >> From: andrew.j.welch@xxxxxxxxx > >> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > >> Subject: Re: [xsl] xslt transformation did not create any output > >> > >> Roelof, it seems like you've skipped 'hello world' as you are missing > >> some of the basics... maybe give that a go before struggling on. > >> > >> > >> -- > >> Andrew Welch > >> http://andrewjwelch.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] xslt transformation did n, Boudewijn Bosgoed | Thread | Re: [xsl] xslt transformation did n, Wendell Piez |
Re: [xsl] XML-to-XML recursive temp, Wendell Piez | Date | Re: [xsl] xslt transformation did n, Wendell Piez |
Month |