[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Aargh - wrong template applied
You haven't shown your source document, but my guess is that your font elements are in a namespace. Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Ian Eure [mailto:ieure@xxxxxxxxxx] > Sent: 19 April 2006 01:08 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Aargh - wrong template applied > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm sure this is something simple I'm overlooking, but I just > can't make this work. > > I have this stylesheet: > > <xsl:stylesheet version='1.0' > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:gale="http://www.gale.com/eBook" > xmlns:php="http://php.net/xsl" > exclude-result-prefixes="gale php"> > > <xsl:output method="xml" > version="1.0" > indent="yes" > encoding="utf-8" > omit-xml-declaration="yes"/> > > <xsl:template match="@*|node()"> > <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy> > </xsl:template> > > <xsl:template match="font"> > <xsl:apply-templates/> > </xsl:template> > > </xsl:stylesheet> > > I want to pass through the document as-is in most cases, but > make certain changes elsewhere. I have a generic pass-through > rule, and a more specific rule to strip out <font> elements, > but retain their children. However, the latter template is > never called, and I can't figure out why. > > I'm using XSLTProc. Turning on it's verbose mode gives me > some relevant information: > > added pattern : '@*' priority -0.500000 > added pattern : 'node()' priority -0.500000 added pattern : > 'font' priority 0.000000 > > Looks good, but then: > > xsltProcessOneNode: applying template '@*|node()' for font > > Why isn't the latter template ever applied, and how do I get > the behavior I want? > > - -- > Ian Eure > Developer, > eNotes.com LLC > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.1 (Darwin) > > iD8DBQFERX9fxuUdPD6j2IMRAjcnAJ957AsILKXEZNC7JcwMa+LzoOeADgCfTjr4 > esWfqHwRvCfITqeNmOeaUcQ= > =KsVw > -----END PGP SIGNATURE-----
|
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
|