On Tue, Jun 30, 2020 at 04:10:23PM -0000, Chris Papademetrious
christopher(_dot_)papademetrious(_at_)synopsys(_dot_)com scripsit:
Hello! Language is XSLT 2.0, processor is Saxon-PE 9.9.1.7 in Oxygen XML
Editor v22.1.
I'm trying to pass attribute nodes from an element template to a function,
make a modified copy of the attributes inside the function, then return them
for inclusion in the element. But when I attempt this, I get
Cannot create an attribute node (class) whose parent is a document node.
You put the attributes in a variable:
<xsl:variable name="new_atts">
<xsl:sequence select="$orig_atts"/>
</xsl:variable>
By default, any untyped variable will be created as a document node.
You avoid that by using "as" to specify a type, specifically that this
variable is a sequence of one or more attributes:
<xsl:variable name="new_atts" as="attribute()+">
<xsl:sequence select="$orig_atts"/>
</xsl:variable>
(Possibly zero or more, which would make it "attribute()*".
--
Graydon Saunders | graydonish(_at_)gmail(_dot_)com
Þæs oferéode, ðisses swá mæg.
-- Deor ("That passed, so may this.")
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--