History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CASTOR-2265
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Werner Guttmann
Reporter: Vikas Rawat
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
castor

AnyNode changing namespace prefix to first one encountered for sibling nodes (if the namespace uri is reused) in case of marshalling

Created: 18/Jan/08 06:51 AM   Updated: 14/Mar/08 06:41 AM
Component/s: XML
Affects Version/s: 1.1.2.1
Fix Version/s: 1.2

Time Tracking:
Original Estimate: 30 minutes
Original Estimate - 30 minutes
Remaining Estimate: 0 minutes
Time Spent - 40 minutes
Time Spent: 40 minutes
Time Spent - 40 minutes

File Attachments: 1. Zip Archive bug-2265_test-src.zip (152 kb)
2. Text File patch.c2265.20080118.txt (7 kb)

Environment: Java 1.5

Testcase included: yes
Patch Submitted: Yes


 Description  « Hide
AnyNode changing namespace prefix to first one encountered for sibling nodes (if the namespace uri is reused).
If AnyNode has the following XML

<f:firstname xmlns:f="http://name.namespace">
<f:text>John</f:text>
</f:firstname>
<l:lastname xmlns:l="http://name.namespace" >
<l:text>Right</l:text>
</l:lastname>

The namespace after unmarshalling & marshalling for the second node (re-using namespace URI but a different prefix)
is changed to the namespace prefix of the first one i.e.
After an unmarshall and marshall, the resulting XML will be

<f:firstname xmlns:f="http://name.namespace">
<f:text>John</f:text>
</f:firstname>
<!-- Note the change here, the XML is invalid now -->
<f:lastname xmlns:l="http://name.namespace">
<f:text>Right</f:text>
</f:lastname>

The marshalled XML now has "f:lastName" with namespace declaration of "xml:l", resulting in INVALID XML.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Vikas Rawat - 18/Jan/08 06:57 AM
Included
1. Testcase
2. Readme.txt
3. Unified Patch
4. Mapping / Entity / Input XMLs

Werner Guttmann - 18/Jan/08 04:35 PM
Final patch for review.