Hi Martin,
This works just as well, and the intent is more obvious. I like it.
As a follow-up question, is there an as="..." expression for an anonymous
document node? I try to declare as="..." as a best practice in my stylesheets.
It would be nice to differentiate between intentionally wanted anonymous
document nodes and forgotten as="..." declarations. I didnbt see an
anonymous document node listed at
19.1 Determining the Static Type of a Construct
https://www.w3.org/TR/xslt-30/#determining-static-type
If no such declaration exists, I can use a comment to indicate intent.
* Chris
From: Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Sunday, March 19, 2023 8:04 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: differentiating between *the* document node and anonymous
document nodes
Am 3/19/2023 um 12:44 PM schrieb Chris Papademetrious
christopher.papademetrious@xxxxxxxxxxxx<mailto:christopher.papademetrious@syn
opsys.com>:
The $main-doc solution worked perfectly for my needs!
Or you need e.g. a global
<xsl:variable name="main-doc" select="/"/>
and can then match on
document-node()[. is $main-doc]/*
Thinking about it again, in XSLT 3 you should be able to match on
$main-doc/*
directly instead of the
document-node()[. is $main-doc]/*
XSL-List info and
archive<https://urldefense.com/v3/__http:/www.mulberrytech.com/xsl/xsl-list__
;!!A4F2R9G_pg!aWTYxyLLRsSQ6uV19kd9o09At9YvScgzht_MZw7cKsWe_odEQsMaZ7xrW6EkZvT
RL4b2WaxKaUVO8vo73u554_NSOfzjtLU21H2SNNWjDluKSB1jMryK$>
EasyUnsubscribe<https://urldefense.com/v3/__http:/lists.mulberrytech.com/unsu
b/xsl-list/3380743__;!!A4F2R9G_pg!aWTYxyLLRsSQ6uV19kd9o09At9YvScgzht_MZw7cKsW
e_odEQsMaZ7xrW6EkZvTRL4b2WaxKaUVO8vo73u554_NSOfzjtLU21H2SNNWjDluKSH8p86WH$>
(by email<>)
|