[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] How to count number of "concat()" args in XPath expression
- From: Olivier JEULIN <olivier.jeulin@gmail.com>
- To: xml-dev@lists.xml.org
- Date: Thu, 29 Aug 2013 13:34:32 +0200
Did you try to replace
concat( a, b, … )
with
count(( b, b, … ))
?
2013/8/29 Hermann Stamm-Wilbrandt <STAMMW@de.ibm.com>:
>
> I wanted to know the (huge) argument number count of a "concat()" call in
> a customer stylesheet.
>
> Since I did not want to write my own XPath expression parser I made use of
> the "Too many arguments to user-created function" error of DataPowwer XSLT
> Processor. As can be seen below Saxon 6.5.5 (XSLT 1.0) processor can be
> used for that, too.
>
> I created a small stylesheet with a "func:concat()" user defined function.
> In that I inserted 900 parameters created by
> $ for((p=100; p<1000; ++p)) do echo "<xsl:param name=\"$p\"/>"; done
>
> Finally I modified "concat()" call to "func:concat()".
>
> Binary search and recompile finally identified the argument count 814(!).
>
> My question is, whether determining the argument count can be achieved
> easier (with any tool/language). Can XSLT 2.0 (3.0) help here?
>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:func="http://exslt.org/functions"
>>
> <func:function name="func:concat">
> <xsl:param name="a100"/>
> <xsl:param name="a101"/>
> ...
> ...
> <xsl:param name="a911"/>
> <xsl:param name="a912"/>
> <!--<xsl:param name="a913"/>-->
> <func:result select="$a912"/>
> </func:function>
> ...
> ...
> <xsl:template match="/">
> <xsl:value-of select="func:concat('SELECT',
> ...
>
>
> Mit besten Gruessen / Best wishes,
>
> Hermann Stamm-Wilbrandt
> Level 3 support for XML Compiler team and Fixpack team lead
> WebSphere DataPower SOA Appliances
> https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
> https://twitter.com/HermannSW/ http://www.stamm-wilbrandt.de/ce/
> ----------------------------------------------------------------------
> IBM Deutschland Research & Development GmbH
> Vorsitzende des Aufsichtsrats: Martina Koederitz
> Geschaeftsfuehrung: Dirk Wittkopp
> Sitz der Gesellschaft: Boeblingen
> Registergericht: Amtsgericht Stuttgart, HRB 243294
>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>
--
Envoyé depuis Firefox et analysé grâce à Hadoop par la NSA (via Gmail©®™) 😏
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]