Completed

Read XML file & extract attributes into variables

Read XML file & extract attributes into variables

1) I have an xml file with below content

<requestXML class="[url removed, login to view]" _list_="false"><App_ConfigureFolderRequest> <processinginstructioninfo> <user _type_="13" userId="546" userName=""/> <locale _type_="66" localeId="0"/> <formatFlags continueOnError="0" elementBased="0" filterUnInitializedFields="0" formatted="0" ignoreUnknownTags="1" skipIdToNameConversion="1" skipNameToIdConversion="0"/> </processinginstructioninfo> </App_ConfigureFolderRequest>

2) Need to remove the highlighted tag from above xml file

3) Next...need to extract all the xml attributes like "userId" value, "userName" value etc into variables

4) The xml code may change dynamically with few other attributes like "cliendID", how do I check if those attributes exists and extract into a variable.

Note: I have tried using string operations, it works fine in eclipse but it fails in my third party application that uses Java in the background. I think, we have to use XML Parsing....

Below is the code that i've used, it works in eclipse as I said above...

String content = new Scanner(new File("C:\\[url removed, login to view]")).useDelimiter("\\Z").next();

String s1 = "userId";

//[url removed, login to view](content);

int b = [url removed, login to view]("userId");

[url removed, login to view]("userId is @ "+ b);

String s2 = [url removed, login to view](b+8,b+11);

[url removed, login to view](s2);

Thanks

Skills: Java, Python, XML

See more: how to read attribute value from xml file in c#, python xml get attribute value, get xml attribute value c# xdocument, get xml node attribute value c#, how to get attribute value in xml using c# linq, python elementtree get attribute value, python xml find element with attribute value, python read xml file example, read xml file actionscript, python read xml file sax, dom parsing read xml file vbnet, aspnet read xml file xpath, vbnet read xml file, read xml file xcode, read xml file using extjs

About the Employer:
( 1 review ) Hyderabad, India

Project ID: #16118613

Awarded to:

super2lao

Hi, Dear Employer! How are you? I am really interested in your project. I have enough experience on python, C/C++, C#, java programming. I am 100% sure i can satisfy your requirements perfectly. I want a long ter More

₹2500 INR in 3 days
(96 Reviews)
7.0

8 freelancers are bidding on average ₹5590 for this job

deytps86

Hi, I worked in various XML parsing event using DOM, SAX even STax. Pretty interesting event. Can we further talk? Thanks!

₹10000 INR in 3 days
(18 Reviews)
4.4
shwetagupta099

4.5 years of strong experience in analysis, design, development and implementation of enterprose solution using the technologies Java, J2EE, Spring and Hibernate. Good Experience in internet technologies like JSF/Prim More

₹3333 INR in 1 day
(1 Review)
0.8
mprabhu174

Hello, I have 10 years of Experience Android and worked on 30+ major projects.I am Interested in doing your Project. I will assure Quality in my work and good responsiveness from my side:) Android, JAVA, XML, ANDRO More

₹3333 INR in 10 days
(1 Review)
0.6
behnamarbab

I have related experiences on this kind of problems, and it's not a big deal for me, I can handle it in this weekend.

₹4444 INR in 1 day
(0 Reviews)
0.0
DrErroo

I'd love to do my best to help you

₹7777 INR in 3 days
(0 Reviews)
0.0
Sejalrudani

Hi, I have 6 year exp in same. I have also worked on xml and json having good knowledge of it. worked on java technology

₹10000 INR in 2 days
(0 Reviews)
0.0
₹3333 INR in 1 day
(0 Reviews)
0.0