commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-386) XMLConfiguration setProperty(), then save() corrupts and deletes XML nodes
Date Thu, 11 Jun 2009 14:51:07 GMT


Oliver Heger commented on CONFIGURATION-386:

To be honest: no idea!

Is it possible to provide a simple example (a XML document and a short code fragment) where
the error occurs?

Could it somehow depend on the content of the file? If you remove the part of the XML document
that is stripped by the save() operation, does {{setProperty()}} then work correctly? It may
be an issue with the encoding, perhaps due to incorrect encoding parts of the content are
interpreted as list delimiters or file end markers? Just speculating. Did you try to set an
encoding explicitly using the {{setEncoding()}} method?

> XMLConfiguration setProperty(), then save() corrupts and deletes XML nodes
> --------------------------------------------------------------------------
>                 Key: CONFIGURATION-386
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: Windows XP, latest Eclipse, Configuration 1.6
>            Reporter: Daniel Hurwitz
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> When using XMLConfiguration to input an XML file, after performing setProperty(), then
save() to a new output file, some nodes near the end of the file are removed and I notice
some nodes are split, as demonstrated below:
> original XML:
> <A>
>   <B> w1 w2 w3 w4 w5</B>
>   <C> v1 v2 v3 </C>
> </A>
> after doing setProperty("A.C","changes"), then save():
> file contains:
> <A>
>    <B> w1 w2 </B>
>    <B> w3 w4 </B>
>    <B> w5 </B>
> </A>
> Note: If I input the XML and immediately save() it without using setProperty() to make
a change, the new output file looks identical to the original. There are about 500 <A>
constellations. In the latter 15 or so, the C nodes are removed in the new output XML. Also,
It doesn't make sense to me why it would split the <B> into a few. Could the encoding
of the XML affect the setProperty() method? I ask because the <C> nodes contain Hebrew
letters. Yet that's interesting that it works, except for removing the latter 15 or 20 <C>
> Any thoughts on how to resolve this? Thanks in advance!

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message