[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: [XSL] Implicit Predicate Casting
At 2007-10-13 15:49 +0200, Alain wrote:
But there is still something that puzzles me a lot, and I still don't find the part that specifies the behaviour described below. Because when the predicate is not of type "number", then the argument is cast to type "boolean". A non-empty string is cast to boolean true, so all members are exposed. A result tree fragment or temporary tree always casts to boolean true, so all members are exposed. Only when the predicate is of type "number" is the "position()=" implied. And also, why is the result different if the version of XSL is set 1.0. It would then give only <p>(2) element[$pos]=first</p> <p>(3) element['2']=first</p> Because <xsl:value-of/> acts on only the first of the addressed nodes in document order. All three are being addressed, but only the first is being returned. And by the way, I'm very newbie with xsl:fallback and stuff like that, is there a way I can run this stylesheet with Internet Explorer without having to comment out the last two lines of the template, because I.E. complains about the attribute "as" of xsl:variable which, indeed, does not exist in 1.0 ? (so that's the third question !) Because that's a compile-time error there is no way around it. There are runtime ways of avoiding version issues encountered during execution: <xsl:if test="system-property('xsl:version')>=2"> </xsl:if> ... or maybe it's a bug of I.E. that should not complain with this attribute "as" and just ignore it, as Firefox does... or is this behaviour "implementation dependant" ? XSLT 1.0 Section 2.1: "It is an error for an element from the XSLT namespace to have attributes with expanded-names that have null namespace URIs (i.e. attributes with unprefixed names) other than attributes defined for the element in this document." I hope this helps. These are actually common questions in the classroom. . . . . . . . . . . . . . . Ken
|
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
|