How to modify a nested XML element using Java
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 1
- Joined: Tue Jul 03, 2018 2:28 pm
How to modify a nested XML element using Java
I have an XML file stored in src/test/resources.
I am trying to do the following:
1. Retrieve the XML Body
2. Modify a nested element within the body
3. Convert the XML body to a string
Below is a sample XML:
So I want to change Client.Location.Address.Line1 within my java method, & then convert that entire XML to a string. But, I don't want to overwrite the original XML.
Can this be done?
I am trying to do the following:
1. Retrieve the XML Body
2. Modify a nested element within the body
3. Convert the XML body to a string
Below is a sample XML:
Code: Select all
<Client>
<Name>
</Name>
<Location>
<Address>
<Line1>Test Address<Line1>
</Address>
</Location>
</Client>
Can this be done?
-
- Posts: 9421
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to modify a nested XML element using Java
Hi,
This forum is for posting questions related to Oxygen XML Editor.
The Java runtime environment contains a DOM API which allows you to parse XML as a structure of nodes and to modify it:
http://www.tutorialspoint.com/java_xml/ ... cument.htm
Regards,
Radu
This forum is for posting questions related to Oxygen XML Editor.
The Java runtime environment contains a DOM API which allows you to parse XML as a structure of nodes and to modify it:
http://www.tutorialspoint.com/java_xml/ ... cument.htm
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service