Hi,
 
Is there a bug in the SAXContentHandler or the SAXWriter?
 
I wanted to use the DOM4J in my Cocoon2 app and built a simple DOM4JAbstractTransformer, which uses the SAXContenthandler to build a document which is then left to the user to do whatever he/she want to.
After that I use the SAXWriter to send the events down a SAX pipeline..
 
My SimpleTransformer extends the DOM4JAbstractTransformer and does nothing! with the document.

The source XML looks like this:
 
<?xml version="1.0" encoding="iso-8859-1"?>
    <page xmlns:page="http://www.spectral.se/datawise/30" xmlns:xform="http://www.w3.org/2001/06/xforms" xml:lang="sv">
        <!-- model + instance for a component -->
        <xform:xform id="search" href="http://">
        <xform:submitInfo id="ID" target="http://www.spectral.se/raa/page" method="..."/>
        <!-- THE MODEL PART NOT IMPLEMENTED  -->
        <xform:model id="" type="" href=""/>
        <xform:instance id="" href="">
            ...
             ...
 
I´m using the SAXContenHandler to build the document.

The class DOM4JBuilder I´ve built extends SAXContentHandler and overrides the endDocument function to notify another method that the document is parsed and that its available for processing.
 
public void endDocument() {
    super.endDocument();
    this.notify(this.contentHandler.getDocument());
}
 
I don´t do anything to the document before writing to the logContenthandler.

Question:
1. Where did the comment go?
2. Where did the startPrefixMapping come from?
3. Or is it simply my source XML that is to blame? :-)
 
Thanks in advance,
 
/Mats

The before log is what is being sent to the SAXContentHandler and the after is what is written from the SAXWriter...
 
Before transform:
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [setDocumentLocator]
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startDocument]
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startPrefixMapping] prefix=page,uri=http://www.spectral.se/datawise/30
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startPrefixMapping] prefix=xform,uri=http://www.w3.org/2001/06/xforms
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startElement] uri=,local=page,raw=page
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 1. uri=,local=page,qname=xmlns:page,type=CDATA,value=http://www.spectral.se/datawise/30
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 2. uri=,local=xform,qname=xmlns:xform,type=CDATA,value=http://www.w3.org/2001/06/xforms
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 3. uri=http://www.w3.org/XML/1998/namespace,local=lang,qname=xml:lang,type=CDATA,value=sv
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
 
 

LOOK HERE !!! ---- >  INFO    99362   [cocoon  ] (tcpConnection-8080-0): [comment]  model + instance for a component
 

INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
 
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startElement] uri=http://www.w3.org/2001/06/xforms,local=xform,raw=xform:xform
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 1. uri=,local=id,qname=id,type=CDATA,value=search
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 2. uri=,local=href,qname=href,type=CDATA,value=http://
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
  
 
After transform:
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [setDocumentLocator]
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startDocument]
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startPrefixMapping] prefix=page,uri=http://www.spectral.se/datawise/30
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startPrefixMapping] prefix=xform,uri=http://www.w3.org/2001/06/xforms
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startElement] uri=,local=page,raw=page
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 1. uri=,local=page,qname=xmlns:page,type=CDATA,value=http://www.spectral.se/datawise/30
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 2. uri=,local=xform,qname=xmlns:xform,type=CDATA,value=http://www.w3.org/2001/06/xforms
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 3. uri=http://www.w3.org/XML/1998/namespace,local=lang,qname=xml:lang,type=CDATA,value=sv
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
 
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
 
 

LOOK HERE ---- >  INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startPrefixMapping] prefix=xmlns,uri=
 

INFO    99362   [cocoon  ] (tcpConnection-8080-0): [startElement] uri=http://www.w3.org/2001/06/xforms,local=xform,raw=xform:xform
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 1. uri=,local=id,qname=id,type=CDATA,value=search
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [            ] 2. uri=,local=href,qname=href,type=CDATA,value=http://
 
INFO    99362   [cocoon  ] (tcpConnection-8080-0): [characters]
  
 

 

Reply via email to