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

SQLTransformer doubles namespace declarations in output

           Summary: SQLTransformer doubles namespace declarations in output
           Product: Cocoon 2
           Version: 2.0.3
          Platform: Sun
        OS/Version: Solaris
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: general components
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When SQLTransformer's output is fed into an XSLT transformation, the following 
namespace declarations is inserted: 
xmlns:xmlns:sql="http://apache.org/cocoon/SQL/2.0";.
The doubling of "xmlns" causes the XSLT transformation to fail, of course.
This is due to the the prefix mapping, which is not properly closed sometimes. 
I envisaged a rather crude, but used in some other transformers, solution: 
start and end prefix mapping whenever there is a valid ContentHandler, without 
other checks.
The code that works for me (taken from SQLTransformer.java) follows:

   public void startPrefixMapping( String prefix, String uri )
        throws SAXException {
        if (super.contentHandler!=null) {
            super.contentHandler.startPrefixMapping(prefix,uri);
        }
    }
    public void endPrefixMapping( String prefix )
    throws SAXException {
        if (super.contentHandler!=null) {
            super.contentHandler.endPrefixMapping(prefix);
        }
    }

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

Reply via email to