[
https://issues.apache.org/jira/browse/XALANJ-2722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17800996#comment-17800996
]
Mukul Gandhi edited comment on XALANJ-2722 at 12/28/23 1:09 PM:
----------------------------------------------------------------
[~martin.honnen],
At this moment, I'm able to provide a workaround XSLT stylesheet for this issue
as follows,
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/*">
<distinct-values-of-name>
<xsl:variable name="inpSeq" select="for $elem1 in * return
name($elem1)"/>
<xsl:value-of select="distinct-values($inpSeq)"/>
</distinct-values-of-name>
</xsl:template>
</xsl:stylesheet>
The above mentioned XSLT stylesheet produces following XML document
transformation result,
<?xml version="1.0" encoding="UTF-8"?><distinct-values-of-name>p
html:p</distinct-values-of-name>
At this moment, XalanJ's XPath 3.1 processor on this dev branch, doesn't
support parse and evaluation of XPath expression of form */name() (i.e,
currently, XPath function name as XPath step is not supported).
was (Author: mukul_gandhi):
[~martin.honnen]
At this moment, I'm able to provide a workaround XSLT stylesheet for this issue
as follows,
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/*">
<distinct-values-of-name>
<xsl:variable name="inpSeq" select="for $elem1 in * return
name($elem1)"/>
<xsl:value-of select="distinct-values($inpSeq)"/>
</distinct-values-of-name>
</xsl:template>
</xsl:stylesheet>
The above mentioned XSLT stylesheet produces following XML document
transformation result,
<?xml version="1.0" encoding="UTF-8"?><distinct-values-of-name>p
html:p</distinct-values-of-name>
At this moment, XalanJ's XPath 3.1 processor on this dev branch, doesn't
support parse and evaluation of XPath expression of form */name() (i.e,
currently, XPath function name as XPath step is not supported).
> attempt to use XPath 3 expression gives StackOverflowError
> ----------------------------------------------------------
>
> Key: XALANJ-2722
> URL: https://issues.apache.org/jira/browse/XALANJ-2722
> Project: XalanJ2
> Issue Type: Bug
> Security Level: No security risk; visible to anyone(Ordinary problems in
> Xalan projects. Anybody can view the issue.)
> Components: transformation, Xalan, Xalan-CmdLine
> Reporter: Martin Honnen
> Assignee: Gary D. Gregory
> Priority: Major
> Attachments: distinct-values-name-test1.xsl,
> xhtml-elements-sample1.xml
>
>
> This is a bug report on the XSLT 3.0 development branch of XalanJ.
> I get an error
> {noformat}
> (java.lang.StackOverflowError): null
> Exception in thread "main" java.lang.RuntimeException
> at org.apache.xalan.xslt.Process.doExit(Process.java:1158)
> at org.apache.xalan.xslt.Process.main(Process.java:1131){noformat}
> when trying to run the following -in and -xsl samples through the command
> line of that branch:
> XML:
> {code:java}
> <root>
> <p xmlns="http://www.w3.org/1999/xhtml">Paragraph 1.</p>
> <html:p xmlns:html="http://www.w3.org/1999/xhtml">Paragraph 2.</html:p>
> </root>{code}
> XSLT:
>
> {code:java}
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="3.0"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> exclude-result-prefixes="xs">
> <xsl:output method="xml" indent="yes"/>
> <xsl:template match="/*">
> <distinct-values-of-name>
> <xsl:value-of select="distinct-values(*/name())"/>
> </distinct-values-of-name>
> </xsl:template>
> </xsl:stylesheet>
> {code}
>
>
>
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]