xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arek Stryjski <develo...@krzyzowki.net.pl>
Subject setSavePrettyPrint and saving with SAX
Date Thu, 29 Jul 2004 16:37:55 GMT
Hi,

In latest version of XmlBeans (1.0.3) I got the problem then saving XmlBeans
into eXist using SAX: save(ContentHandler, LexicalHandler, XmlOptions). By
mistake I left some settings to XmlOptions used in debuging:

  op.setSavePrettyPrint();
  op.setSavePrettyPrintIndent(4);

Then I run program I get: "SAXParseException: Content is not allowed in trailing
section." (I add printStackTrace at the end).

Then I remove this two settings from option everything is OK. I believe this is
happening because in org.apache.xmlbeans.impl.store.Saver.SaxSaver you always
call ContentHandler.characters(char, int, int); never
ContentHandler.ignorableWhitespace(char, int, int); also for sending formating
whitespace.

Javadoc for characters(char, int, int) says:
"Note that some parsers will report whitespace in element content using the
ignorableWhitespace method rather than this one (validating parsers must do so)."
In my opinion this allow sending formating whitespace with characters(), but it
looks like eXist or Xerces developers have opposite opinion.

It surprise me what with BEA XmlBeans version there was no such a problem with
eXist. Was SaxSaver not sending whitespace in first version?

eXist is using xerces-2.6.1.jar and xalan-2.5.2.jar

best regards
Arek




-----------------------------------------------------

org.xml.sax.SAXParseException: Content is not allowed in trailing section.
 at org.exist.Indexer.fatalError(Indexer.java:279)
 at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
 at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
 at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
 at
org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.dispatch(Unknown
Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
 at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
 at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
 at org.exist.collections.Collection.addDocument(Collection.java:727)
 at org.exist.collections.Collection.addDocument(Collection.java:616)
 at org.exist.xmldb.LocalCollection.storeXMLResource(LocalCollection.java:486)
 at org.exist.xmldb.LocalCollection.storeResource(LocalCollection.java:433)


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message