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

Re: XPath equivalence question

Subject: Re: XPath equivalence question
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Thu, 1 Dec 2011 11:48:34 +0100
Re:  XPath equivalence question
> You changed the posted example to be an xpath rather than an xslt
> pattern. The two expressions are clearly not equivalent as Xpath, but
> they are as patterns. The question was about the pattern form (despite
> the subject line:-)

Thanks for clarifying, find the corrected stylesheets below.


I cannot answer Graydon's original question for saxon or xsltproc.

But I just generated visual output of DataPower XSLT processor stylesheet
compilation. Both stylesheets get compiled differently (zoom intended):
http://stamm-wilbrandt.de/en/xsl-list/Graydon.12t.xsl.gif

Stylesheet profiling did not show any difference for the two templates,
both accounted for 160ms in processing 25000 requests each on DataPower
box.


$ xsltproc Graydon.1t.xsl Graydon.xml
<?xml version="1.0"?>
<B/>
$
$ xsltproc Graydon.2t.xsl Graydon.xml
<?xml version="1.0"?>
<B/>
$
$ cat Graydon.xml
<A><a><b><c><B/></c></b></a></A>
$
$ cat Graydon.1t.xsl
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
  <xsl:output method="xml"/>

  <xsl:template match="/A//B">
    <xsl:copy-of select="."/>
  </xsl:template>

</xsl:stylesheet>
$
$ cat Graydon.2t.xsl
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
  <xsl:output method="xml"/>

  <xsl:template match="B[/A]">
    <xsl:copy-of select="."/>
  </xsl:template>

</xsl:stylesheet>
$


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team, Fixpack team lead
WebSphere DataPower SOA Appliances
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


                                                                                                                                        
  From:       David Carlisle <davidc@xxxxxxxxx>                                                                                         
                                                                                                                                        
  To:         xsl-list@xxxxxxxxxxxxxxxxxxxxxx,                                                                                          
                                                                                                                                        
  Cc:         Hermann Stamm-Wilbrandt/Germany/IBM@IBMDE                                                                                 
                                                                                                                                        
  Date:       12/01/2011 10:51 AM                                                                                                       
                                                                                                                                        
  Subject:    Re:  XPath equivalence question                                                                                      
                                                                                                                                        





On 01/12/2011 09:43, Hermann Stamm-Wilbrandt wrote:
> Have you tried out what you propose as equivalent below?
>
> No XSLT processor is doing what you say, xsltproc, saxon, DataPower, ...
>

You changed the posted example to be an xpath rather than an xslt
pattern. The two expressions are clearly not equivalent as Xpath, but
they are as patterns. The question was about the pattern form (despite
the subject line:-)

David



--
google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

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.