File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to change XML Beans Namespace

 
Brad Ko
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know what methods I can use to remove and redefine the default namespace? I'm using xmlbeans(v2.2.0).

For our project, I want to redefine the namespace on the orignal xml to look like the target xml (see XML examples below).

=====Orignal XML=====
<ClientData xmlns="http://www.company.com">
<customerInformation>
<accessCard>
<accessCardNumber>45xxxxxxxxxx99</accessCardNumber>
</accessCard>
</customerInformation>
<w3:Info xmlns="http://company.org/schemas" xmlns:w3="http://www.company.com">
<w3:Count>6</w3:Count>
<w3:AddDataFlag>N</w3:AddDataFlag>
<w3:VendorList>
<w3:PayeeID>00001</w3:PayeeID>
<w3:PayeeTkn>###123456</w3:PayeeTkn>
<w3:PayeeName>AAAAAAA</w3:PayeeName>
<w3:CustPayeeID>00000</w3:CustPayeeID>
<w3:PayeeDataType/>
<w3:PayeeData/>
</w3:VendorList>
</w3:Info>
</ClientData>

====Target XML=====
<ClientData xmlns="http://www.company.com">
<customerInformation>
<accessCard>
<accessCardNumber>45xxxxxxxxxx99</accessCardNumber>
</accessCard>
</customerInformation>
<Info>
<Count>6</Count>
<AddDataFlag>N</AddDataFlag>
<VendorList>
<PayeeID>00001</PayeeID>
<PayeeTkn>###123456</PayeeTkn>
<PayeeName>AAAAAAA</PayeeName>
<CustPayeeID>00000</CustPayeeID>
<PayeeDataType/>
<PayeeData/>
</VendorList>
</Info>
</ClientData>

Thanks in advance.
 
Brad Ko
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nobody can answer for this question?
 
Paul Clapham
Sheriff
Pie
Posts: 20187
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I wanted to transform your original XML into your target XML, I would just use XSLT to do that. Should be pretty simple. But you said you were using XML Beans, and I know nothing about that, so I didn't answer.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic