[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Resolved: (XMLBEANS-196) Pretty print not always handling xml encoded ampersands
From:       "Cezar Andrei (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2005-10-26 0:16:01
Message-ID: 513441198.1130285761812.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

     [ http://issues.apache.org/jira/browse/XMLBEANS-196?page=all ]
     
Cezar Andrei resolved XMLBEANS-196:
-----------------------------------

    Fix Version: Version 2
     Resolution: Cannot Reproduce

This bug has already been fixed, most probably by 314983, since I tried all kinds of \
combinations and they all work fine. Also the line numbers are now different than the \
ones in the stack trace. Chris can you please check it and reopend the bug if this is \
the case, including a small repo.

> Pretty print not always handling xml encoded ampersands
> -------------------------------------------------------
> 
> Key: XMLBEANS-196
> URL: http://issues.apache.org/jira/browse/XMLBEANS-196
> Project: XMLBeans
> Type: Bug
> Versions: Version 2
> Environment: dev2lt 10:52 AM > java -version
> java version "1.5.0_01"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
> Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode)
> dev2lt 01:46 PM > uname -a
> Linux dev2lt 2.6.12-1.1398_FC4smp #1 SMP Fri Jul 15 01:30:13 EDT 2005 i686 i686 \
>                 i386 GNU/Linux
> Reporter: Chris Lamey
> Priority: Minor
> Fix For: Version 2

> 
> 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:186)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic