Page 1 of 1

Not able to group similar type elements with same value

Posted: Thu Oct 24, 2019 8:53 am
by javauser007
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.

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

Posted: Thu Oct 24, 2019 11:32 am
by adrian
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

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

Posted: Thu Oct 24, 2019 11:54 am
by javauser007
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.

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

Posted: Thu Oct 24, 2019 2:24 pm
by javauser007
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

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

Posted: Fri Oct 25, 2019 11:30 am
by adrian
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