Re: [xsl] 3 XSLT2 quickies

Subject: Re: [xsl] 3 XSLT2 quickies
From: Soren Kuula <dongfang@xxxxxxxxxxx>
Date: Fri, 17 Mar 2006 17:18:16 +0100
Hi, thanks once more Michael,

Note also that the rule about concatenating text nodes comes into play here:
if your input were

<a>foo<!--hey!-->bar</a>

the result would be "foobar" rather than "foo-ostrich-bar" because of the
rule that adjacent text nodes are concatenated before atomization.


OK, that makes sense ... as in IDREFS value, it also has length 1 anyway, regardless of the comment.

document-node(schema-element(rubberduck))


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


Obviously this only works when used as a step in a path expression, or as pattern: not for example when used in an "as" attribute.

Technically I think the rewrite is more like:

document-node()[count(child::*)=1 and count(child::text()=0) and
(child::schema-element(rubberduck))]


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?

Soren

Current Thread