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

Re: getting "Cannot create an attribute node (...) who

Subject: Re: getting "Cannot create an attribute node (...) whose parent is a document node" when copying attribute nodes through an XSLT function
From: "Norman Tovey-Walsh ndw@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 30 Jun 2020 16:19:11 -0000
Re:  getting "Cannot create an attribute node (...) who
>     <!-- make a copy of the attributes (a proxy for processing) and return
them -->
>     <xsl:function name="mine:recopy">

Try <xsl:function name="mine:recopy" as="attribute()*">

I think whatbs happening is that, because your function doesnbt declare
its return type, what itbs returning is wrapped in a document node and
you canbt do that with attributes.

As a general rule, declare the types of your parameters and what your
functions and templates construct.

                                        Be seeing you,
                                          norm

--
Norman Tovey-Walsh <ndw@xxxxxxxxxx>
https://nwalsh.com/

> One of my most productive days was throwing away 1000 lines of
> code.--Ken Thompson

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

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.