You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by bu...@apache.org on 2003/11/01 22:13:32 UTC

DO NOT REPLY [Bug 24326] New: - SQLTransformer mishandles columns with XML data that have XML Declaration

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=24326>.
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=24326

SQLTransformer mishandles columns with XML data that have XML Declaration

           Summary: SQLTransformer mishandles columns with XML data that
                    have XML Declaration
           Product: Cocoon 2
           Version: 2.1.2
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: sitemap components
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: andrzej@chaeron.com


The SQLTransformer has a problem if you store XML data in a database column and 
the XML starts with a standard XML declaration (eg. something like: <?xml 
version="1.0"?> ).

The serializeData() method in the embedded Query class checks for an initial "<" 
character to see if it should try to parse the column data as XML.  The problem 
is that if the data in the column is valid XML, but has the declaration, when 
the code in that method wraps the column data in a <root> tag, this results in 
the declaration being inside a tag, thus causing the parsing to fail, and the 
method to revert to just copying the column data across.

Fix is to change the Query.serializeData() method to the following to test for 
and strip any initial XML declaration it finds.

Fixed code for this method will be attached.

....Andrzej