[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Fundimentle Predicate Problem or Bug??
Hi I tried asking for help a while back on this, anyway now I have worked out exactly where my issue is and will provide examples below. Assume this data.... <?xml version="1.0" encoding="utf-8"?> <ORCB082> <ROWSET> <ROW num="1"> <Fixture> <FixtureDate>2008-10-17</FixtureDate> <FixtureDayText>DAY ONE TEST</FixtureDayText> <Race> <RaceType>S</RaceType> </Race> <Race> <RaceType>H</RaceType> </Race> </Fixture> </ROW> </ROWSET> </ORCB082> Stylesheet 1 ------------ This stylesheet outputs "DAY ONE TEST" message, IMO it should match no records and not output anything. <?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <xsl:for-each select="/ORCB082/ROWSET/ROW/Fixture[FixtureDate >= '2008-01-01' and FixtureDate <= '2010-01-01' and Race/RaceType >= 'R' and Race/RaceType <= 'R']" > <xsl:message><xsl:value-of select="FixtureDayText"/></xsl:message> </xsl:for-each> </xsl:template> </xsl:stylesheet> Stylesheet 2 ------------ This stylesheet outputs nothing - which is what I would expect, but essentially is stylesheet 1 not performing the same logic as 2? <?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="text" indent="yes"/> <xsl:template match="/"> <xsl:for-each select="/ORCB082/ROWSET/ROW/Fixture[FixtureDate >= '2008-01-01' and FixtureDate <= '2010-01-01' and Race/RaceType = 'R']" > <xsl:message><xsl:value-of select="FixtureDayText"/></xsl:message> </xsl:for-each> </xsl:template> </xsl:stylesheet> Conclusion ----------- Like so many of us working in the XML / XSLT world I find it difficult to adjust to a different way of working. Essentially had I wrote this logic in SQL or 4GL or VB etc etc I'd be sure that it would work. I hope nobody is offended by me suggesting this may be a bug! Thanks in advance. Chris
|
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
|