[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

3 XSLT2 quickies

Subject: 3 XSLT2 quickies
From: Soren Kuula <dongfang@xxxxxxxxxxx>
Date: Thu, 16 Mar 2006 22:11:56 +0100
xslt2
Hi,

Can anyone help me sort of (I don't have a running Saxon around):

1) If the element a is declared with, say, the simple nonatomic IDREFS type as its simpleContent

and I have an instance document with

<a> foo bar baz</a>

and that a element becomes the context node for
 <value-of select="."/>

I should get as output the (one) text node with
foo bar baz

right? But really, behind the scenes, it was atomized and re-de-atomized :), so I assume that
<value-of select="." separator="-ostrich-"/>


should get me
foo-ostrich-bar-ostrich-baz

Is that a complete misunderstanding?

If not, well what about:
 <value-of select="./text()" />
or
 <value-of select="./text()" separator="-ostrich-"/>

My _understanding_ is that they should both just output

foo bar baz

because text() doesn't atomize, but I am open for any objections.



Another one: XSLT2 will validate even temporary trees, right? But will that not make a funny difference sometimes?

If the declaration of a was a simpleContent complex type, with an aoptional attribute x with the default value "goat", then I seem to recall that an XSD should add that attribute if it is not there.

Does that not mean that

<variable name="v1">
 <a xsl:validation="strict">foo bar</a>
</variable>

and

<variable name="v2">
 <a>foo bar</a>
</variable>

will behave differently in

<some-instruction select="$one-of-the-above/@x"/>

--- namely the selection finding asn attribute in one case, and nothing in the other?



Finally

The

document-node(schema-element(rubberduck))

node test is one bastard to analyze (I'm doing static analysis on XSLT): It tests not one, but tow nodes.

Are there any great dangers in converting it to

document-node()[child::schema-element(rubberduck)]

? A great danger is if the original version, as a pattern, can match something that the rewritten version cannot.


Thanks for any help


Soren

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.