Re: [xsl] XPath equivalence question

Subject: Re: [xsl] XPath equivalence question
From: Hermann Stamm-Wilbrandt <STAMMW@xxxxxxxxxx>
Date: Thu, 1 Dec 2011 11:48:34 +0100
> 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: [xsl] 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