Questions tagged [xml-parsing]

An XML parser goes through text documents containing XML trees and allows the information in the hierarchy to be used. Use this tag for problems implementing an XML parser or generated by the use of an existing parser in a given language.

An XML parser goes through text documents containing XML trees and allows the information in the hierarchy to be used. Use this tag for problems implementing an XML parser or generated by the use of an existing parser in a given language.

An XML parser converts an XML document into an XML DOM object - which can then be manipulated with JavaScript. All modern browsers have a built-in XML parser.

The XML document specification places requirements on what an XML processor must do and not do, but the application is outside its scope. The processor (as the specification calls it) is often referred to colloquially as an XML parser.

13856 questions
29
votes
2 answers

How to fix error: The markup in the document following the root element must be well-formed

I put my code in the XML validation website and it gives me this error: Line 8: 4 The markup in the document following the root element must be well-formed. The line that is having an issue is the
Mereinid
  • 295
  • 1
  • 3
  • 5
28
votes
2 answers

Where I can find a detailed comparison of Java XML frameworks?

I'm trying to choose an XML-processing framework for my Java projects, and I'm lost in names.. XOM, JDOM, etc. Where I can find a detailed comparison of all popular Java XML frameworks?
yegor256
  • 102,010
  • 123
  • 446
  • 597
27
votes
6 answers

xml2js: how is the output?

I m trying to use the node.js module xml2js My code is quite simple: function testparse(pathname, callback) { var parser = require('xml2js').Parser(), util = require('util'), fs = require('fs'), fs.readFile(pathname, function…
DrakaSAN
  • 7,673
  • 7
  • 52
  • 94
27
votes
1 answer

What is the difference between setContentView and LayoutInflater?

I am creating a tabs list with several fragments. I have noticed that, in the main activity, I used setContentView to get the layout xml and use findViewById to get the corresponding UI element…
user782104
  • 13,233
  • 55
  • 172
  • 312
26
votes
2 answers

DOMDocument in php

I have just started reading documentation and examples about DOM, in order to crawl and parse the document. For example I have part of document shown below:
Saikios
  • 3,623
  • 7
  • 37
  • 51
26
votes
2 answers

How to Parse Big (50 GB) XML Files in Java

Currently im trying to use a SAX Parser but about 3/4 through the file it just completely freezes up, i have tried allocating more memory etc but not getting any improvements. Is there any way to speed this up? A better method? Stripped it to bare…
Joe Maher
  • 5,354
  • 5
  • 28
  • 44
26
votes
5 answers

Golang XML Unmarshal and time.Time fields

I have XML data I am retrieving via a REST API that I am unmarshal-ing into a GO struct. One of the fields is a date field, however the date format returned by the API does not match the default time.Time parse format and thus the unmarshal…
Darrrrrren
  • 5,968
  • 5
  • 34
  • 51
26
votes
1 answer

Using CDATA inside another CDATA

I have this difficult situation where I need to use the CDATA tags inside another CDATA tags. The situation is simple to explain though. I have the following thing:
aborted
  • 4,481
  • 14
  • 69
  • 132
25
votes
4 answers

find xml element based on its attribute and change its value

I am using python xmlElementTree and want to assign or modify a xml element value based on its attribute. Can somebody give me an idea how to do this? For example: Here is a xml file and I need to set the value for the element "number" based on the…
user1282251
  • 251
  • 1
  • 3
  • 3
25
votes
14 answers

Better way to detect XML?

Currently, I have the following c# code to extract a value out of text. If its XML, I want the value within it - otherwise, if its not XML, it can just return the text itself. String data = "..." try { return XElement.Parse(data).Value; } catch…
cyberconte
  • 2,371
  • 4
  • 21
  • 27
25
votes
2 answers

Access nested children in xml file parsed with ElementTree

I am new to xml parsing. This xml file has the following tree: FHRSEstablishment |--> Header | |--> ... |--> EstablishmentCollection | |--> EstablishmentDetail | | |-->... | |--> Scores | | |-->... |-->…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
25
votes
3 answers

oracle plsql: how to parse XML and insert into table

How to load a nested xml file into database table ? Tom
California Los angeles
Frank
  • 1,315
  • 7
  • 24
  • 43
24
votes
5 answers

How to remove XML tags from Unix command line?

I am grepping an XML File, which gives me output like this: data more data ... Note, this is a flat file, not an XML tree. I want to remove the XML tags and just display the data in between. I'm doing all this from the command…
Tarski
  • 5,360
  • 4
  • 38
  • 47
24
votes
3 answers

Folding (expanding and colapsing) xml tags in vim (xml parsing)

I know that % in vim will jump from one tag to another, I also know how to use visual mode to select entire blocks between tags in an xml file, using o to jump from the top to the bottom tags. I've done multiple web searches and have the matchit…
Deesbek
  • 865
  • 2
  • 12
  • 27
24
votes
1 answer

Invalid Content Was Found Starting With Element 'country'. One Of '{country}' Is Expected.. Line '10', Column '14'

I am trying to resolve this issue but could not understand the root cause of this error: Invalid Content Was Found Starting With Element 'country'. One Of '{country}' Is Expected.. Line '10', Column '14' Here is my xml:
nwzhaider
  • 359
  • 1
  • 3
  • 16
Crap