[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] Conditional text using attributes
Subject: RE: [xsl] Conditional text using attributes From: "Chris Bayes" <Chris@xxxxxxxxxxx> Date: Thu, 28 Dec 2000 17:26:04 -0000 |
Beth, Have you tried <xsl:template match="*|@*|comment()|text()"> <xsl:if test="not(@os='Mac')"> <xsl:copy-of select="." /> </xsl:if> </xsl:template> Ciao Chris XML/XSL Portal http://www.bayes.co.uk/xml >-----Original Message----- >From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx >[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Beth Fischi >Sent: 28 December 2000 16:42 >To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx >Subject: [xsl] Conditional text using attributes > > >I'm trying to figure out how to exclude text and graphics from an output >file (HTML or FO, for example) by testing for attributes in my XSL >stylesheet. For instance, I have an XML file with instructions >appropriate for both Macintosh users and Windows users. In one output >file, I want to exclude the instructions for Mac users, and in another, >I want to exclude the instructions for Windows users so I end up with a >set appropriate to each type of user. > >I'm using the DocBook DTD and Norm Walsh's DocBook XSL stylesheets >(http://nwalsh.com/docbook/xsl/index.html). I've created an XSL file >called "bj.xsl" that extends his HTML XSL stylesheet. In it, I have a >test case that (hopefully?) excludes all elements, attributes, comments >and text with the attribute "Mac": > >***************************************** ><?xml version='1.0'?> ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version='1.0' > xmlns="http://www.w3.org/TR/xhtml1/transitional" > exclude-result-prefixes="#default"> > ><xsl:include href="docbook.xsl"/> > ><xsl:template match="*|@*|comment()|text()"> > <xsl:if test="not(@os='Mac')"> > <xsl:copy> > <xsl:apply-templates select="*|@*|comment()|text()" /> > </xsl:copy> > </xsl:if> ></xsl:template> > ></xsl:stylesheet> >***************************************** >This doesn't work, but I'm not sure what I'm doing wrong. Any >suggestions would be greatly appreciated. > >--Beth Fischi > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Conditional text using at, Steve Muench | Thread | [xsl] utf-16 encoding, GarethS |
RE: [xsl] Iteration in XSL, Chris Bayes | Date | RE: [xsl] utf-16 encoding, Chris Bayes |
Month |