Hello,

It's in as XMLBEANS-196, currently unassigned as I don't know who should
get it or even what Component this affects.

I don't have a fix, but it looks like the inner class PrettySaveCur in
Saver.java isn't handling the character counts correctly.  If I get some
time I'll try to figure out the specifics.

Cheers,
topher

On Fri, 2005-09-02 at 12:18 -0700, Cezar Andrei wrote:
> This sure seems like a bug, would you open up a bug in JIRA so we can
> track it. Also if you have a patch for it, it would be very much
> appreciated.
> 
> Cezar
> 
> > -----Original Message-----
> > From: Christopher Lamey [mailto:[EMAIL PROTECTED]
> > Sent: Friday, September 02, 2005 2:19 PM
> > To: user@xmlbeans.apache.org
> > Subject: pretty print and ampersands
> > 
> > Hello,
> > 
> > The following elements in our xml cause a
> > java.lang.ArrayIndexOutOfBoundsException in
> Document.save(StringWriter,
> > XmlOptions) in xmlbeans when we first call setSavePrettyPrint() on the
> > XmlOptions object we pass into the Document.save(StringWriter,
> > XmlOptions) method:
> > 
> >       <value>uranium miner &amp;</value>
> >       <value>uranium miner &amp; s</value>
> >       <value>uranium miner &amp;        </value>
> > 
> > These do not:
> > 
> >       <value>uranium miner &amp;  s</value>
> >       <value>&amp;</value>
> > 
> > Basically, we're seeing that any "&amp" at the end of an element value
> > needs to have a non-whitespace character at least three characters
> from
> > the right of it in order to avoid the problem.
> > 
> > If setSavePrettyPrint() is not called, everything works.
> > 
> > Here's the stack against the 2.0.0 xmlbeans release:
> > 
> > java.lang.ArrayIndexOutOfBoundsException
> >     at java.lang.System.arraycopy(Native Method)
> >     at org.apache.xmlbeans.impl.store.Saver
> > $TextSaver.replace(Saver.java:1438)
> >     at org.apache.xmlbeans.impl.store.Saver
> > $TextSaver.entitizeContent(Saver.java:1269)
> >     at org.apache.xmlbeans.impl.store.Saver
> > $TextSaver.emitText(Saver.java:966)
> >     at org.apache.xmlbeans.impl.store.Saver.process(Saver.java:288)
> >     at org.apache.xmlbeans.impl.store.Saver
> > $TextSaver.ensure(Saver.java:1466)
> >     at
> > org.apache.xmlbeans.impl.store.Saver$TextSaver.read(Saver.java:1553)
> >     at org.apache.xmlbeans.impl.store.Saver
> > $TextReader.read(Saver.java:1680)
> >     at org.apache.xmlbeans.impl.store.Cursor._save(Cursor.java:609)
> >     at org.apache.xmlbeans.impl.store.Cursor.save(Cursor.java:2554)
> >     at
> >
> org.apache.xmlbeans.impl.values.XmlObjectBase.save(XmlObjectBase.java:18
> 6)
> > 
> > Is this expected behavior?
> > 
> > Cheers,
> > topher
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to