2

Hi I'm trying to do XSLT transformation, In this process I'm using predefined function "exsl:node-set($MyVar)" this function is working fine in oxygen xml editor but Altova XMLspy throws an error "XPST0017: The function call 'exsl:node-set' does not match the name of a function in the static context". And WSO2 XSLT transformation also unable to do transformation. How can i solve this problem ?

  • If you use an XSLT 2.0 processor then you don't need `exsl:node-set` at all, you can simply use the variable reference `$MyVar` directly. If you use an XSLT 1.0 processor then you need to check what kind of extension function it supports to convert a result tree fragment into a node-set, assuming your variable really has that kind of value. – Martin Honnen Jul 19 '17 at 11:05
  • And if you want to make minimum changes to your stylesheet, you can simply create a dummy implementation: `` – Michael Kay Jul 19 '17 at 11:29
  • thank you **Martin Honnen** for your response. Already I tried that one. When I use $MyVar it will goes to loop and transformation is failed. Is there any alternate.. – Ashok Shiva Palaki Jul 19 '17 at 12:46
  • **Michael Kay** when I use **** I got "ALXT0005: Instruction stack overflow" error. – Ashok Shiva Palaki Jul 19 '17 at 12:51
  • @AshokShivaPalaki, can you be more specific as to which XSLT processors and language versions do you need to run the code with? Which XSLT processor does wso2 use? Or is Altova XML Spy the target you want to run the code with? As for the two errors you say you get with the two suggestions, it might help if you edit the question and show minimal but complete samples that cause that error. – Martin Honnen Jul 19 '17 at 14:54
  • @MartinHonnen This is my code I found error at exsl:node-set($MyVar) in Alotova XMLspy we are testing then we are deploying the code in WSO2. In WSO2 I'm using XSLT transformation component. – Ashok Shiva Palaki Jul 20 '17 at 06:41
  • @AshokShivaPalaki, I don't know details about the XSLT processor used in WSO2, please check with `system-property('xsl:vendor')` what the system uses. As for your code, you have an infinite recursion in there with your apply-templates, change it to `` to avoid that. – Martin Honnen Jul 20 '17 at 07:45
  • @MartinHonnen Actually in my code I have another template I missed that template because lack of space. And I tried with `` But it won't remove the error still it displays the same error in Altova XMLspy – Ashok Shiva Palaki Jul 20 '17 at 11:17
  • As far as I understand it, Altova does not support `exsl:node-set`, but it also does not need it. So if you want to develop with Altova then you can't use `exsl:node-set`, unless you (use XSLT 2.0) and follow the suggestions by Michael Kay. However, in that case, to avoid the "stack overflow" error, you will need to use the suggestion I made. So to make it clear, my suggestion of `` is meant to avoid the stack overflow error once you use an XSLT processor where `exsl:node-set` is supported or you have added a function "adding" the support. – Martin Honnen Jul 20 '17 at 11:20
  • And don't cite lack of space, you can always edit your question text and provide code snippets there that will be more readable and better formatted than anything you put into a comment. – Martin Honnen Jul 20 '17 at 11:22
  • @MartinHonnen I'm using xml version=1.0 and XSLT version 2.0 even though exsl:node-set not working. If Altova does't support exsl:node-set then is there any alternative to execute the code which are available in variable _**MyVar**_ ..? – Ashok Shiva Palaki Jul 20 '17 at 12:52
  • See my very first comment, you don't need `exsl:node-set($var)` in XSLT 2.0, simply use `$var`. – Martin Honnen Jul 20 '17 at 12:59

0 Answers0