Martin Honnen created XALANJ-2820:
-------------------------------------

             Summary: expand-text needs to work in xsl:comment and 
xsl:processing-instruction
                 Key: XALANJ-2820
                 URL: https://issues.apache.org/jira/browse/XALANJ-2820
             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/1.8
            Reporter: Martin Honnen


This is a bug report against the latest XSLT 3.0 development branch of Xalan.

I have seen that expand-text is now supported, however, I have found, that it 
fails to work in xsl:comment and xsl:processing-instruction.

 

So a test case of e.g.

{code:xml}
<?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";
  xmlns:map="http://www.w3.org/2005/xpath-functions/map";
  xmlns:array="http://www.w3.org/2005/xpath-functions/array";
  exclude-result-prefixes="#all"
  expand-text="yes">

  <xsl:output method="html" indent="no"/>

  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="/">
    <xsl:copy>
      <xsl:apply-templates/>
      <debug-test>Run with {system-property('xsl:vendor')} at 
{current-dateTime()}</debug-test>
      <xsl:processing-instruction name="pi-test">Run with 
{system-property('xsl:vendor')} at 
{current-dateTime()}</xsl:processing-instruction>
      <xsl:comment>Run with {system-property('xsl:vendor')} at 
{current-dateTime()}</xsl:comment>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>
{code}

outputs e.g.

{code:xml}
<debug-test>Run with Apache Xalan at 2025-08-01T08:08:03Z</debug-test>
{code}
for the debug-test element (i.e. the expand-text has been done) while the 
processing instruction and the comment are output as 
{code:xml}
<?pi-test Run with {system-property('xsl:vendor')} at {current-dateTime()}>
<!--Run with {system-property('xsl:vendor')} at {current-dateTime()}-->
{code}
meaning the expand-text has not been done.
 



--
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

Reply via email to