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

Re: XSLT3 deep-equal() question

Subject: Re: XSLT3 deep-equal() question
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Mar 2020 17:35:01 -0000
Re:  XSLT3 deep-equal() question
The shallow-copy drops type annotations on element nodes, so there could be a
false result if the input is typed (i.e. schema-validated). The effect of type
annotations on deep-equal() is somewhat arcane (I have no recollection of how
the rules were arrived at).

Apart from that I think you're guaranteed a true result. But I could be
wrong!

I can't see why having external entities would make any difference.

Michael Kay
Saxonica

> On 27 Mar 2020, at 16:43, Alan Painter alan.painter@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Hello XSLT Community,
>
> I'm Using XSLT3 (Saxon 9.9 HE).
>
> I'm wondering if it's reasonable to expect deep-equal() to always return
true in the following scenario.  I suspect "yes" but wondering what corner
cases that I might encounter.
>
> We'll be pushing some data-oriented source documents, with no external
entities, through templates which are all in a mode defined from
"shallow-copy" similar to the below.
>
> What I'm wondering under what conditions of source documents that the
following stylesheet would return "false" rather than "true".  (Again,
excluding external entities.) I'm hoping that the list of conditions is nil or
very small.
>
> Thanks for any help.
>
> <xsl:stylesheet
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform
<http://www.w3.org/1999/XSL/Transform>"
>     xmlns:xs="http://www.w3.org/2001/XMLSchema
<http://www.w3.org/2001/XMLSchema>"
>     version="3.0">
>
>   <xsl:mode name="a" on-no-match="shallow-copy"/>
>
>   <xsl:output method="text" />
>
>   <xsl:template match="/" >
>       <xsl:variable name="afterApply">
>           <xsl:apply-templates select="/" mode="a"/>
>       </xsl:variable>
>       <xsl:sequence select="deep-equal(/, $afterApply) => string()" />
>   </xsl:template>
>
> </xsl:stylesheet>
>
> Alan Painter
> Confined in France
>
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email <>)

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.