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

Re: 3 XSLT2 quickies

Subject: Re: 3 XSLT2 quickies
From: Soren Kuula <dongfang@xxxxxxxxxxx>
Date: Fri, 17 Mar 2006 17:53:23 +0100
Re:  3 XSLT2 quickies
Michael Kay wrote:

Stand by; can a document node ever, every contain text nodes?

Aren't the specified in XDM or even Infoset, to only have element (exactly one), child or processing-instruction children?




Whenever you write

<xsl:variable name="x">banana</xsl:variable>

you are creating a document node that is the parent of a single text node.


OK, thanks again.

Just a yes / no one:

I understand (correctly???) that I can do

<xsl:variable name="x" as="schema-element(a)">
 <xsl:apply-templates select="//foo"/>
</xsl:variable>


The question is, what happens if I run that on a schema-aware processor, and the <apply-templates.../> evalutates to something which is not a valid a element? I see something about function conversion rules .. but I'm in doubt what will happen here.


The basic question behind this is from may static analysis: If I statically know the schema declaration of element a (and all its declared descendants), and I see a variable binding elenet / a stylesheet function declaration with as=schema-element(a) (give or tak an OccurenceIndicator), can I assume that the variable at run-time is really bound to a valid a? And will its descendants be valid, too?

If YES, then I will have a really easy time of statically simulating a <copy-of select="$x"/> -- it's a valid a.

My understanding so far is NO.

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.