Patches for JDOMSource and JDOMResult (was: Re: [jdom-interest] JDOMResult silently absorbs document fragments)

Markus Pallo pallo at dig.de
Wed Aug 21 06:44:45 PDT 2002


Hello,

i continued now my tests. It looks like xerces is unable to parse the 
document fragment which is created in SAXOutputter dtdEvents(Document 
document). Also caucho sax parser tells unable to parse Document.
The root element is missing. 
If i add the root element in line 677 of SAXOutputter its working
 
----------- snip -----
buf.append('>');
String dtdDoc = 
buf.append('<').append(docType.getElementName()).append("/>").toString();
----------- end snip -----

But i am not sure, if its correct for the context of fire dtd events.....

Markus


On Tuesday 20 August 2002 17:08, Markus Pallo wrote:
> Hi,
>
> it looks like he checks now the dtd, but crashes later...
> see the stackTrace...
>
> I will continue with the checks tomorrow.
>
> Markus
>
>
>
> java.lang.ArrayIndexOutOfBoundsException
>         at org.apache.xerces.impl.dtd.DTDGrammar.endParameterEntity(Unknown
> Source)
>         at
> org.apache.xerces.impl.dtd.XMLDTDProcessor.endParameterEntity(Unknown
> Source) at org.apache.xerces.impl.XMLDTDScannerImpl.endEntity(Unknown
> Source) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown
> Source) at
> org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown Source)
>         at
> org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown Source)
>         at
> org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(Unknown
> Source)
>         at org.apache.xerces.impl.XMLDTDScannerImpl.skipSeparator(Unknown
> Source)
>         at org.apache.xerces.impl.XMLDTDScannerImpl.scanDecls(Unknown
> Source) at
> org.apache.xerces.impl.XMLDTDScannerImpl.scanDTDExternalSubset(Unknown
> Source) at
> org.apache.xerces.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(Unknow
>n Source)
>         at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
>         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>         at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source) at org.jdom.output.SAXOutputter.dtdEvents(SAXOutputter.java:680) at
> org.jdom.output.SAXOutputter.output(SAXOutputter.java:597) at
> org.jdom.transform.JDOMSource$DocumentReader.parse(JDOMSource.java:432)
>         at
> org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:493)
>         at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java
>:590) at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java
>:1054) at
> org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java
>:1032) at
> de.dig.dfc.framework.TransformerService.transformToFop(TransformerService.j
>ava:327) at
> de.dig.dfc.framework.TransformerService.process(TransformerService.java:117
>)
>
> Markus
>
> On Tuesday 20 August 2002 14:12, you wrote:
> > Hi,
> >
> > Attached are 2 patches (full source and cvs diff) for JDOMSource and
> > JDOMResult that fix the following problems:
> >
> >   - JDOMSource: Do no allocate a new XMLReader for every call to
> > getXMLReader(). JDOMSource now allocates only one XMLReader and returns
> > this instance for every call to getXMLReader(), thus allowing
> > applications to access the XMLReader instance and configure it prior
> > handing the JDOMSource to the XSL transformer.
> >
> >   - JDOMResult: Support for transformation results that are not
> > well-formed XML documents. JDOMResult now accepts node sets as result of
> > transformations and make them available to the applications as a List of
> > JDOM nodes (method getResult()). Existing methods dealing only with
> > Documents have been marked as deprecated.
> >
> > Markus, could you run a quick test to verify that the JDOMSource patch
> > fixes your EntityResolver problem?
> > Elliotte, could you check the new JDOMResult interface and
> > implementation?
> >
> > TIA
> >
> > Laurent
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourho
>st.com



More information about the jdom-interest mailing list