Questions tagged [xml-parsing]

1

votes
1

answer
85

Views

pulling multiple entries in xml with different data using R

I have a set of XML files that I am reading in, and wanted to know the best way to deal with the following: X1234 DOBMismatch PrimaryChecksFail IncomeReferral At the moment, I am running some R code but get the response: Error: Duplicate identifiers for rows (2, 3, 4) The intended output is a datafr...
Northernlad
1

votes
1

answer
310

Views

Parsing xml in python gives null values

I'm programming in python and I'm trying to read the status of my Yamaha network stereo. I get the following xml response On All good so far. Now, I'm trying to search for Power to get the latest status. It is there in XML but I can't locate the Power Status value when I use a XML parser such as...
Tony De La Rosa
1

votes
3

answer
186

Views

Parsing XML converted Json using Java

Below is the JSON, in which I need to parse the value of: 'primaryInvolvedParty': { } The response is XML, hence it is converted into JSON, so that I can parse it easily. Converting XML to JSON using: String messageBody = actualResult.get('StatusMessage'); JSONObject xmlconvertedjson=XML.toJSONObje...
Nithin
1

votes
1

answer
150

Views

How to retrieve all the child tags based on given parent tag using XML and Java?

I have an XML file and I want to read all the child nodes / tags values for the given Parent tag. Sample XML content: SOUTH CHESTERFIELD USA US 9998, N. MICHIGAN ROAD. 23834 VA true false RCI 1 RCI false true false FRANK 804/733-3004 USD EN EN BROWNING B en_US For example, if I provide the tag like...
Karunagara
1

votes
1

answer
145

Views

How to read <image> tag containing Title, Image and url from rss feed

I was able to get all data inside item tag i.e Title, Link, Description, Image and PublishedDate, below is my XMLParser class if (eventType == XmlPullParser.START_TAG) { if (xmlPullParser.getName().equalsIgnoreCase('item')) { insideItem = true; } else if (xmlPullParser.getName().equalsIgnoreCase('ti...
Abduraq Abdul
0

votes
1

answer
29

Views

Shred XML into multiple rows in SQL

I have to shred an XML document every two weeks. It is compliant with the NEMSIS 2 standard and I have a compliant database built to hold the info. I've successfully built a query to import all of the one-to-one data, but I'm having trouble shredding the one-to-many data. Using this demo data: dec...
dav
1

votes
3

answer
344

Views

Remove special characters in xml file R

I have a few thousand xml files that I would like to read into R. The problem is that some of these files have three special characters '' in the beginning of the file that stops xmlTreeParse from reading the xml file. The error that I get is the following... Error: 1: Start tag expected, '
Atreya Dey
1

votes
1

answer
101

Views

PHP Out-of-memory when parsing very large xml file 2.77 GB

when I am parsing 14 MB xml file everything works well, but when I need to parse 2.77 GB server crashes with out-of-memory. I tried to add memory and execution time with: ini_set('max_execution_time', 600); set_time_limit('600'); ini_set('memory_limit','1024M'); it works unlimited without end Here i...
kostya572
1

votes
0

answer
148

Views

How to get data safely from DOM object when multiple threads are accessing same object

I have multiple threads trying to read the same DOM object and runs simultaneously. But I heard that, DOM is not thread safe and somewhere I read that if we clone the document, that cloned document will be thread safe. this is what I wanted to try import java.io.File; import javax.xml.parsers.Docume...
HimaaS
1

votes
0

answer
47

Views

XML parsing with KSoap 2 Library

I have no experience with soap XML parsing. So Please any one suggest me how to get this response using K soap2 library
Ansari
1

votes
0

answer
29

Views

r - Merging multiple XML pages calling a data frame of URLs

I am trying to create a big data frame made of multiple xml pages. I am able to create a data frame for a single page: library(RCurl) US_GrossiOS200
euclideans
1

votes
2

answer
694

Views

Modify Child Node Value With C# XML Document Class

I am a total noob, so apologies, but I have searched everywhere and I'm still stuck. I am writing a program which will modify 2 XML docs after the user has selected an initial XML document and renamed it. Once the user changes the filename of the first XML (let's call it XML #1), the other two XML d...
jamlot
1

votes
0

answer
105

Views

efficient way of loading XML file in scala

What is the efficient way of loading XML file in Scala? I do not want to load the complete file into memory as they can go upto 1 GB in my case, but read only required tags. Let me know. Thanks
Pratap D
1

votes
0

answer
712

Views

lxml.etree.XMLSyntaxError: internal error: Huge input lookup

I'm trying to parse a large xml file (~500 MB) with python lxml library, the iterparse, using: context = etree.iterparse('large-file.xml') for event, element in context: # do some stuff element.clear() but it returns the following error: Traceback (most recent call last): File 'test.py', line 176,...
Ali Zarezade
1

votes
0

answer
111

Views

How to parse xml element with text inside and with child element?

This is my not well formed XML and i dont have any chance to edit it. I just need to parse it. I tried jackson but its throwing me error. Some text Any other solution?
Joseph Move
1

votes
0

answer
185

Views

How to convert parse html with System.Xml.XmlDocument

I'm trying to parse XML with this C# code; htmltext = File.ReadAllText('index.html'); var soup = new System.Xml.XmlDocument(); soup.LoadXml(htmltext); var items = soup.SelectNodes('//[@class='repo-list-item']'); When running the code i get this error: Unhandled Exception: System.Xml.XmlException: Ex...
Don't Know
1

votes
1

answer
225

Views

How to skip a field and only unmarshal a specific member of that field using JAXB?

I need to unmarshal an XML file for which I have created a model. in the XML file, I have an element name which in my model is a member of a field of type Person. what I want to do is to unmarshal 'name' element into person.name but the problem is that in the XML file there is no node for Person and...
kvs
1

votes
0

answer
35

Views

SAXParser parse complex object

I am a novice in SAXParser. I don't know is it possible to parse complex object with SAXParser. I have a class which contain Item list. And my response xml is like that : OKUser is temporary blocked12223232 And my POJO class is like following: @XmlRootElement(name = 'PGResponse') public class CheckA...
Resul Rzaeeff
1

votes
1

answer
123

Views

Deserialized C# into ASP.NET MVC View

I have deserialized the XML Response from API, now I need to display the deserialized objects to list in ASP.NET MVC View. XML Response: ... ... Controller: public ActionResult Create([Bind(Include='FlightId,Origin,Destination,DepartFromDate,DepartToDate,ReturnFromDate,ReturnToDate,AdultPax,ChildPax...
1

votes
0

answer
92

Views

How to secure DOM Parser

There was a security audit on my product and they have found a vulnerability and their recommendations are An XML parser should be configured securely so that it does not allow document type definition (DTD) custom entities and external entities as part of an incoming XML document. I was able to re...
Prashanth A
1

votes
2

answer
370

Views

Parsing XML elements with Python and Elementtree

I am a python noob trying to parse through an XML API response using Elementtree. The response contains custom data from a form and I am having trouble trying to access some of the nested elements. Below is my code: response = requests.get('https://crm.zoho.com/crm/private/xml/Deals/getCVRecords?new...
AllyA
1

votes
0

answer
79

Views

Python XML attribute returns 'None'

I am trying to print two different attributes out of a specific XML with Python. My XML file and the Python script I am trying to create are below. I get the first print correctly but not the second one. XML: 0 Python Script: import xml.etree.ElementTree xmlReq = xml.etree.ElementTree.fromstring(str...
CDoc
1

votes
0

answer
43

Views

XmlPullParserException while attempting to parse XML as a String

An API returns a String response containing something like the following: 0 123 This response is turned into an InputStream, and passed to a parseXml() method: InputStream stream = new ByteArrayInputStream(response.b...
Orbit
1

votes
1

answer
87

Views

Python -parse xml with variable nested elements into csv

Desperately need help. I am a beginner to Python and have tried for days (and nights) to do this with no success. Have large xml file which has elements (ie. accounts) that has subelements (ie. attributes) with variable sub-sub-elements (ie. attributeValue). Since the sub-sub-element is variable I d...
Kitt
1

votes
0

answer
33

Views

How can i get the console.log result to return as a value?

EDIT!! I managed to get alexa rank in my console.log function() { var a = document.createElement('a'); a.href = this.url; var domain = a.hostname, req = new XMLHttpRequest(), cors = 'https://cors-anywhere.herokuapp.com/'; function init(){ req.addEventListener('load', function(){ var r, n; r = /]...
Isaac
1

votes
1

answer
89

Views

Inflate and render a UI view by a downloaded xml string

I was interested in downloading the xml layout for UI views from a server and inflate that as an xml string. What I see in the doc though is: Therefore, it is not currently possible to use LayoutInflater with an XmlPullParser over a plain XML file at runtime; it only works with an XmlPullParser re...
Jim
1

votes
0

answer
109

Views

How to post body of the xml data in android web service?

i am trying to post request with xml body to the web service using volley api,but it returns output like invalid credentials.below is my code StringRequest stringRequest = new StringRequest(Request.Method.POST, url, new com.android.volley.Response.Listener() { @Override public void onResponse(String...
Rajesh
1

votes
1

answer
55

Views

Python phase XML removing element by certain attributes and replace text within attributes

I have the following XML file: Live Snooker: The World Championship: Day Two - 2018 Coverage of day two at the Crucible Theatre in Sheffield Sport Live UEFA Women's Champions League Manchester City v Lyon (Kick-off 1.00pm) Sport First i'm trying to remove the element icon where the src equals and t...
Jamie B
1

votes
1

answer
32

Views

add contents inside root tag of xml file

I have one existing xml file and want to add some contents to it. Existing xml file: Now I want to add the following contents without modifying contents of existing file My question is how to add contents of xml to existing file without modifying the contents of existing xml file inside this tag :...
kishore
1

votes
0

answer
53

Views

How to know next XML tag in java

This is my xml (dummy xml). I want to know the next XML tag while parsing the XML. e.g. if currently I'm on 'employee' tag then next would be 'facilities'. As I've to process the values according to the xml tags. I'm using stAX parser, but I didn't see any method which will tell me the next XML t...
Teja
1

votes
3

answer
402

Views

How to get xpath from root to particular element in python while parsing xml

I want to list all the elements path in xml with respect to their root. for example Name Name So i want to list them as :- A/B/C A/B/D I am able to parse xml using 'Element' Object of python but not able to extract xpath from it. Any help?
placebo
1

votes
2

answer
100

Views

How to convert SOAP XML to Java Object in android

I want parse and convert the SOAP XML response to JAVA objects. I thought of using J-WS and JAXB to do the same by creating the client stub code. But J-WS and JAXB are not part of Android AOSP hence I have to do it manually. Following is the example of soap xml response. Response to device.GetSystem...
kiran Biradar
1

votes
0

answer
24

Views

VTD-XML can't vn.getText() if text has HTML <B> tags?

The XML looks like this: Sign in with %1$s navigation looks like this: if (vnCurrent.toElement(VTDNav.FIRST_CHILD, 'string')) { while (true) { def currentStringIndex = vnCurrent.getText() // ^^^^ this is always -1 when it hits the strings with def currentStringValue = (currentStringIndex != -1) ? v...
kenyee
1

votes
1

answer
224

Views

Python3 Minidom Parse Data Inside Tag

I am trying to pull the numbers out the tags of this XML file: 1980-12-12 2018-05-04 2018-05-04 178.25 184.25 178.17 183.83 56201317.0 0.0 1.0 178.25 184.25 178.17 183.83 56201317.0 Using this script: #Test Parser from xml.dom import minidom xmldoc = minidom.parse('AAPL.xml') itemlist = xmldoc.getE...
Tommy
1

votes
0

answer
78

Views

org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: not well-formed (invalid token)

I have an SVG file, which I import in Android Studio (Android Studio creates an XML file). Even when importing the file in the preview is shown only black. When I run my test program, it crashes. The crashing code is: SVG svg = SVGParser.getSVGFromResource(getResources(), R.drawable.chde4); Error: o...
1

votes
1

answer
74

Views

name “return” in tag of Response.Return_ conflicts with name “Result” in *Result.XMLName

The actual error is name 'return' in tag of LoginToPublicPortalResponse.Return_ conflicts with name 'ResultVO' in *ResultsVO.XMLName. The code was generated by gowsdl, and its giving a conflict error when I try to call a method. Here is my classes: type LoginToPublicPortalResponse struct { XMLName x...
user7903682
1

votes
1

answer
19

Views

DTD validation in a 3.5 assembly fails when linked in an application targeting 4.6

I have an assembly written in c# that does DTD validation on an input string. It uses XMLReaderSettings.ValidationTpe = ValidationType.DTD and XMLReaderSettings.ProhibitDtd = false. XML validation works fine when linking this assembly in applications that target 2.0, 3.5, 4.0, 4.5 but when the appli...
Richard
1

votes
1

answer
62

Views

How to use IF loop in XML

I have an framework which takes inputs from XML and runs the test . Depending on an parameters which is been sent into XML some tests will be decided to Run or Not . For checking this condition,I need to apply IF loop How to apply IF loop in XML ( I don't want to use XSLT ) . Or is there any meth...
sreevathsabr
1

votes
0

answer
46

Views

bet365/soap package(s) ignores namespace-prefix on elements of type “sequence”

I am using the following erlang package to work with some WSDL-Services: https://github.com/bet365/soap. The most part is working fine! But my WSDL-service expects that elements of type sequence (including all sub-elements) have an existing namespace-prefix in the XML. The problem is that the bet365...
quax
1

votes
0

answer
21

Views

cannot read xml value via powershell

I am trying to read a value from xml via powershell. But i cannot get the VALUE out Following is my script #read xml $mydoc = [xml] @' VALUE '@ I want to retrieve the VALUE. I have tried the following: $mydoc.A1.A2.A3 but that doesn't retrieve VALUE.
Learner

View additional questions