Not able to group similar type elements with same value

Here should go questions about transforming XML with XSLT and FOP.
javauser007
Posts: 6
Joined: Tue Oct 22, 2019 12:53 pm

Not able to group similar type elements with same value

Post by javauser007 » Thu Oct 24, 2019 8:53 am

Hello All,

Can you please help to debug below error?


ERROR:
net.sf.saxon.trans.XPathException: Errors were reported during stylesheet compilation
at net.sf.saxon.style.StylesheetModule.loadStylesheet(StylesheetModule.java:260)
at net.sf.saxon.style.Compilation.compileSingletonPackage(Compilation.java:106)
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:739)
at net.sf.saxon.jaxp.SaxonTransformerFactory.newTemplates(SaxonTransformerFactory.java:155)
at org.apache.camel.builder.xml.XsltBuilder.setTransformerSource(XsltBuilder.java:352)
Wrapped by: net.sf.saxon.s9api.SaxonApiException: Errors were reported during stylesheet compilation
at net.sf.saxon.s9api.XsltCompiler.compile(XsltCompiler.java:742)

Note: I'm using XSLT 2.0

Please throw some light on my problem to proceed further.

Thanks in advance.
Last edited by javauser007 on Tue Oct 29, 2019 1:35 pm, edited 1 time in total.

adrian
Posts: 2655
Joined: Tue May 17, 2005 4:01 pm

Re: Not able to group similar type elements with same value

Post by adrian » Thu Oct 24, 2019 11:32 am

Hi,

Your error is of stylesheet compilation, but you omitted the details that would have shown the actual compilation problem.
Your code starts by using a variable that hasn't been declared: $relation_doc_uri So, it's impossible to say what the code does.
Maybe it's that missing declaration, maybe it's something else.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

javauser007
Posts: 6
Joined: Tue Oct 22, 2019 12:53 pm

Re: Not able to group similar type elements with same value

Post by javauser007 » Thu Oct 24, 2019 11:54 am

Hi Adrian,

I have already declared that variable and it is going inside the if condition. even I'm able to print the $relation_doc_uri . But after that it is failing.

javauser007
Posts: 6
Joined: Tue Oct 22, 2019 12:53 pm

Re: Not able to group similar type elements with same value

Post by javauser007 » Thu Oct 24, 2019 2:24 pm

Hi Adrian,

Thanks for the reply. I have declared the variable $relation_doc_uri and it has proper value.

But my code is not moving inside the below for loop.

<xsl:for-each-group select="$v_ownerships" group-by="source">

Thank you

adrian
Posts: 2655
Joined: Tue May 17, 2005 4:01 pm

Re: Not able to group similar type elements with same value

Post by adrian » Fri Oct 25, 2019 11:30 am

Hi,

I can't debug with variables for which there is no definition.

Code: Select all

<xsl:variable name="v_ownerships" select="$relation_doc_uri/relations/ownerships)" />
I don't know what relation_doc_uri contains, but your XML examples don't have any elements named relations or ownerships.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Post Reply