← Prev in month
← Prev in thread
How to count number of "concat()" args in XPath expression
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
← Prev in month
← Prev in thread