• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to change XML Beans Namespace

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nobody can answer for this question?
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic