Subject: Re: [xsl] Using xsl to test value of node From: Ahmad J Reeves <ahmad@xxxxxxxxxxxxxx> Date: Thu, 13 Dec 2001 15:51:43 +0000 |
Hi David, Many thanks for your help, that makes much more sense now. The parser still throws up the following error: "The element type "xsl:template" must be terminated by the matching end tag </xsl:template>" at the following position <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html"/> <xsl:template match="LOG"> <xsl:apply-templates select="DIRECT"/> </xsl:template> <xsl:template match="DIRECT"> <xsl:apply-templates select="CHARACTER_ID"/> </xsl:template> <xsl:template match ="CHARACTER_ID"> <xsl:if test=".=44639"/> <xsl:apply-templates select="../LOCATION_ID"/> </xsl:if> *here* </xsl:template> <xsl:template name="LOCATION_ID"> <html> <body> <h1> <xsl:value-of select="."/> </h1> </body> </html> </xsl:template> </xsl:stylesheet> Its as if it can't see the </xsl:template> tag underneath. Am I missing something blatant! Probably!! Cheers again Ahmad David Carlisle wrote: > > <xsl:if test() ="44639"/> > XSL stylesheets have to be XML XML attribute names can't include () > so this won't get past the XML parser, so the xslt engine won't see the > stylesheet. You want > <xsl:if test=".=44639"/> > > <xsl:Xpply-templates select="LOCATION_ID"/> > in that template the current node is CHARACTER_ID so the above XPath > would select LOCATION_ID children of CHARACTER_ID nodes, but there are > not any, you want > <xsl:Xpply-templates select="../LOCATION_ID"/> > > David > > _____________________________________________________________________ > This message has been checked for all known viruses by Star Internet > delivered through the MessageLabs Virus Scanning Service. For further > information visit http://www.star.net.uk/stats.asp or alternatively call > Star Internet for details on the Virus Scanning Service. > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list -- ----------------------------------------------------- Ahmad J. Reeves BSc(Hons), MSc(Dist). Phd Student Information, Media, and Communication Research Group, Dept of Computer Science,Queen Mary,University of London, E1 4NS Tel +44 (0)20 7882 5257 http://www.dcs.qmw.ac.uk/imc/ ----------------------------------------------------- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Using xsl to test value o, David Carlisle | Thread | Re: [xsl] Using xsl to test value o, David Carlisle |
RE: [xsl] Dumb questions from a new, Chris Bayes | Date | RE: [xsl] Using xsl to test value o, Chris Bayes |
Month |