[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Differences between Saxon, XT and Xalan: testing an attribut
Hi all, I've simplified my problem to this XML document: <?xml version="1.0" ?> <Record id='1'> <Field No="606"> <Subfield No="x">Use</Subfield> </Field> </Record> to which I apply the following stylesheet: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="Record"> <TestRecord> <xsl:apply-templates/> </TestRecord> </xsl:template> <xsl:template match="Field[@No='606']/Subfield[@No='x']"> <GotAMatch><xsl:apply-templates/></GotAMatch> </xsl:template> </xsl:stylesheet> With both XT (version 19990511) and Xalan (version 0.19.5, not tested with the latest release), I get what I expected, which is: <?xml version="1.0" encoding="utf-8"?> <TestRecord> <GotAMatch>Use</GotAMatch> </TestRecord> But with Saxon (version 5.2), I get the following: <TestRecord> Use </TestRecord> It looks like the template matching "Field[@No='606']/Subfield[@No='x']" is never fired. If I change this template to this: <xsl:template match="Field[@No='606']"> <GotAMatch><xsl:apply-templates/></GotAMatch> </xsl:template> or this <xsl:template match="Subfield[@No='x']"> <GotAMatch><xsl:apply-templates/></GotAMatch> </xsl:template> Now the three processors give me the expected result, identical to the first one. It looks a lot like a bug in Saxon, but may be I'm missing an obscure part in the XSL specs? Thank's for any info, Martin Sevigny sevigny@xxxxxxxxx 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
|