Sorry, seems this got lost in the emails.

The problem seems to be the "." in the width in the document. The spec says
this is an Integer, so the parsing functionality that POI generates out of
the specification applies a new BigInteger(s) on the value of the "W"
element, which fails with a NumberFormatException because it contains
decimal digits.

Unfortunately Word seems to handle this gracefully, although it is defined
differently in the Spec.

A workaround for now should be to get the document created without the
".000", I don't see an easy fix in POI as this happens deep inside the
XML-Parsing functionality provided by XmlBeans and generated code...

Another workaround could be to use the method
doc.getDocument().getBody().getSectPr().getPgSz().xgetW().getDomNode().getNodeValue()
instead which will take the XML-Fragment directly and extract the
string-value which you then can parse yourself.

Dominik.

On Thu, Feb 11, 2016 at 1:28 PM, Perundevi <[email protected]> wrote:

> Any update on this?
>
>
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Xmlvalueoutofbounds-exception-while-reading-a-value-tp5717541p5721923.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to