Martin Honnen created XALANJ-2819: ------------------------------------- Summary: Using xpath-default-namespace results in wrong XSLT result Key: XALANJ-2819 URL: https://issues.apache.org/jira/browse/XALANJ-2819 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 Affects Versions: The Latest Development Code Environment: Windows 11, Java 8 Reporter: Martin Honnen Attachments: xhtml-elements-sample2.xml, xpath-default-namespace-test1.xsl
This is a bug report against the XSLT 3.0 development branch of Xalan. I have seen that there is now support for xpath-default-namespace and while there are lots of test cases in the repository for that new feature I get a failure in my first attempt to try to use it, it appears neither my identity transformation template nor my element selector in template match are used, the transformation only outputs a comment the test case outputs with xsl:comment, but no elements at all. Here is the XSLT: {code:xml} <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xpath-default-namespace="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="#all"> <xsl:output method="html" indent="no"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> </xsl:template> <xsl:template match="ul"> <ol> <xsl:apply-templates/> </ol> </xsl:template> <xsl:template match="/"> <xsl:copy> <xsl:apply-templates/> <xsl:comment>Run with <xsl:value-of select="system-property('xsl:vendor')"/> at <xsl:value-of select="current-dateTime()"/></xsl:comment> </xsl:copy> </xsl:template> </xsl:stylesheet> {code} Here is the XML: {code:xml} <?xml version="1.0" encoding="utf-8"?> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CheerpJ 3 Xalan XSLT 3 development branch XSLT 3 workbench</title> </head> <body> <section> <h1>Release 0.0.4 beta</h1> <section> <h2>Features using Xalan Java XSLT 3 development branch</h2> <ul> <li>XSLT 3.0 against XML input</li> <li>optional automatic evaluation of XSLT as CheerpJ 3 also allows to run Java code (e.g. Xalan) from a web worker</li> <li>errors and warnings are hopefully now all reported in the result/output editor pane</li> </ul> </section> <section> <h2>Supported XSLT 3.0 and XPath 3.1 features</h2> <p>See documentation at <a href="https://xalan.apache.org/xalan-j/xsl3/xalanj_xslt3.0_implementation_status.pdf">https://xalan.apache.org/xalan-j/xsl3/xalanj_xslt3.0_implementation_status.pdf</a></p> </section> </section> </body> </html> {code} Here is the output I get with Xalan: {code:html} <!--Run with Apache Xalan at 2025-07-13T17:10:41+02:00--> {code} Here is the output I expect: {code:html} <!DOCTYPE HTML><html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CheerpJ 3 Xalan XSLT 3 development branch XSLT 3 workbench</title> </head> <body> <section> <h1>Release 0.0.4 beta</h1> <section> <h2>Features using Xalan Java XSLT 3 development branch</h2> <ol> <li>XSLT 3.0 against XML input</li> <li>optional automatic evaluation of XSLT as CheerpJ 3 also allows to run Java code (e.g. Xalan) from a web worker</li> <li>errors and warnings are hopefully now all reported in the result/output editor pane</li> </ol> </section> <section> <h2>Supported XSLT 3.0 and XPath 3.1 features</h2> <p>See documentation at <a href="https://xalan.apache.org/xalan-j/xsl3/xalanj_xslt3.0_implementation_status.pdf">https://xalan.apache.org/xalan-j/xsl3/xalanj_xslt3.0_implementation_status.pdf</a></p> </section> </section> </body> </html><!--Run with Apache Xalan at 2025-07-13T17:10:41+02:00--> {code} -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xalan.apache.org For additional commands, e-mail: dev-h...@xalan.apache.org