xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Vasilik" <eric...@bea.com>
Subject RE: setSavePrettyPrint and saving with SAX
Date Fri, 30 Jul 2004 15:51:35 GMT
I imagine that when pretty printing, I save some white space after the
document element and don't use the ignorable white space method.  This
is probably fixed in v2.

> -----Original Message-----
> From: Arek Stryjski [mailto:developer@krzyzowki.net.pl]
> Sent: Thursday, July 29, 2004 9:38 AM
> To: xmlbeans-user@xml.apache.org
> Subject: setSavePrettyPrint and saving with SAX
> 
> 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.dis
pa
> tch(Unknown
> Source)
>  at
>
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn
> 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:48
6)
>  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/


- ---------------------------------------------------------------------
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