You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/02/22 08:07:03 UTC
DO NOT REPLY [Bug 6636] New: -
XSTLC TransformerImpl 'looses' OutputProperties - With Patch
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6636>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6636
XSTLC TransformerImpl 'looses' OutputProperties - With Patch
Summary: XSTLC TransformerImpl 'looses' OutputProperties - With
Patch
Product: XalanJ2
Version: CurrentCVS
Platform: Other
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: org.apache.xalan.xsltc
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: tim_elcott@bigfoot.com
The org.apache.xalan.xsltc.trax,TransformerImpl.createOutputProperties
retrieves all of the properties from the compiled translets correctly but
returns a Properties instance into _properties with only the default values
set. This is okay but if you retrieve the Properties using the getProperties()
method it looked empty but does reveal its correct values when retrieving each
value by key, one at a time. Not great!
On the transform() method the setOutputProperties(_translet, _properties) is
called. This works over the enumeration of properties reseting the _translet
output property values. Unfortunately there's a one-lines bug in there. A call
to properties.get which does not respect the default values. Ouch - you loose
the lot.
So
Enumeration names = properties.propertyNames();
while (names.hasMoreElements()) {
// Get the next property name and value
String name = (String)names.nextElement();
String value = (String)properties.get(name);
should be
Enumeration names = properties.propertyNames();
while (names.hasMoreElements()) {
// Get the next property name and value
String name = (String)names.nextElement();
String value = (String)properties.getProperty(name); //This works
The symptom I've been chasing is the xsl:output values were never respected so
when say <xsl:output method="html"> the output contains <?xml version="1.0"?>.
My work around now is to work over the properties putting them back in. Quick
and dirty but it will do until the fix is committed.
Quick patch from latest CVS code.
711c711
< String value = (String)properties.get(name);
---
> String value = (String)properties.getProperty(name);