[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using xsl to test value of node
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|