XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[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

Thanks Olivier!

That was the solution I was looking for, counting sequence elements.

While DataPower XSLT processor is still XSLT 1.0 + EXSLT, last December
XQuery 1.0 and JSONiq 0.4.42 support was added to v6.0 appliance firmware.
(DataPower standalone processor for DataPower developers only).

$ xj --xquery count.xq dummy.xml ; echo
814
$
$ java net.sf.saxon.Query -q:count.xq ; echo
<?xml version="1.0" encoding="UTF-8"?>814
$


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


                                                                                                                                                 
  From:       Olivier JEULIN <olivier.jeulin@gmail.com>                                                                                          
                                                                                                                                                 
  To:         xml-dev@lists.xml.org,                                                                                                             
                                                                                                                                                 
  Date:       08/29/2013 01:36 PM                                                                                                                
                                                                                                                                                 
  Subject:    Re: [xml-dev] How to count number of "concat()" args in XPath expression                                                           
                                                                                                                                                 





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©®™)
😏

_______________________________________________________________________

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




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS