The following comment has been added to this issue:

     Author: Henry Zongaro
    Created: Mon, 20 Sep 2004 12:15 PM
       Body:
This behaviour may be surprising, but it's required by JAXP.  From the description of 
Result.PI_DISABLE_OUTPUT_ESCAPING [1]:

  The name of the processing instruction that is sent if the result
  tree disables output escaping.

  Normally, result tree serialization escapes & and < (and possibly
  other characters) when outputting text nodes. This ensures that the
  output is well-formed XML. However, it is sometimes convenient to
  be able to produce output that is almost, but not quite well-formed
  XML; for example, the output may include ill-formed sections that
  will be transformed into well-formed XML by a subsequent non-XML
  aware process. If a processing instruction is sent with this name,
  serialization should be output without any escaping. 

  Result DOM trees may also have PI_DISABLE_OUTPUT_ESCAPING and
  PI_ENABLE_OUTPUT_ESCAPING inserted into the tree.

JAXP uses this mechanism as a way of indicating the presence of text for which output 
escaping is intended to be disabled in DOM and SAX.  In this way, subsequent 
redirection of the DOM tree or SAX events to a StreamResult will exhibit the expected 
behaviour.

Introducing an option to disable this feature might be desirable, but by default the 
processor must emit these processing instructions as there might be TCK tests that 
test for this behaviour.  I don't know whether there actually are.  I will change this 
bug report to an enhancement request.

Given that code that relied on such an option would not be portable, it might be 
better for a user to use a portable solution that is not very difficult to code:  
viz., filtering out these processing instructions "manually".

[1] 
http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/Result.html#PI_DISABLE_OUTPUT_ESCAPING
---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/XALANJ-1945?page=comments#action_53246

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XALANJ-1945

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XALANJ-1945
    Summary: Xalan inserts unasked for processing instructions in output for doe
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: XalanJ2
 Components: 
             Xalan
   Versions:
             2.6

   Assignee: 
   Reporter: elharo

    Created: Sun, 19 Sep 2004 6:49 AM
    Updated: Mon, 20 Sep 2004 12:15 PM

Description:
In some circumstances Xalan adds javax.xml.transform.disable-output-escaping and 
javax.xml.transform.enable-output-escaping processing instructions to the result tree. 

This is incorrect. There's nothing in my stylesheet that indicates this should happen. 
If it's an option, it should be turned off by default, and if it is done it should be 
done at serialization only, not when the result tree is constructed through a 
SAXResult. 

See 
http://www.google.com/search?q=javax.xml.transform.disable-output-escaping&sourceid=mozilla&start=0&start=0&ie=utf-8&oe=utf-8

to note that I'm not the only person this has surprised or caused problems for. 


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to