Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
How to build HierarchicalConfiguration object from xml string content?

I have xml String content which is passed as part of request body in rest API,

<?xml version="1.0" encoding="UTF-8"?>
<sdp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="repository://schemas/sdp-config.xsd">
<helpPage>/mstinc/sdp/help/index.html</helpPage>
<ib>
    <siteUrl>/onlineserv/HB/</siteUrl>
    <startUpPage>
        <sdpUrl>SECONDARY~PRIMARY_BUTTON_ACCOUNT_ACCESS.NAME~ACCOUNT_ACCESS_SECONDARY_BUTTON_SDP.NAME</sdpUrl>
        <otherUrl>SECONDARY~PRIMARY_BUTTON_ACCOUNT_ACCESS.NAME~ACCOUNT_ACCESS_SECONDARY_BUTTON_ACCOUNT_SUMMARY.NAME</otherUrl>
        <axisConfValue>true</axisConfValue>
    </startUpPage>
 </ib>

I would like to build HierarchicalConfiguration object so that i can iterate through keys using,

Iterator keys = {hierachicalObject}.getKeys();

I don't want to create a file as the content is passed dynamically for each request. How can i do it?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I think you can get information from the tag in String and work with this string.

For example :

DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document doc = documentBuilder.parse(xmlFile);
        doc.getDocumentElement().normalize();
String keys = doc.getElementsByTagName("sdpUrl").item(0).getTextContent();

And after that working with keys. But there used file. There you can read how to get data from String XML : Read a XML (from a string) and get some fields - Problems reading XML

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!