tagged [xml-parsing]

How to read from an XmlReader without moving it forwards?

How to read from an XmlReader without moving it forwards? I got this scenario: ``` while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == itemElementName) { XElem...

8 May at 19:8

How to use XMLReader in PHP?

How to use XMLReader in PHP? I have the following XML file, the file is rather large and i haven't been able to get simplexml to open and read the file so i'm trying XMLReader with no success in php `...

9 Apr at 10:31

xml.LoadData - Data at the root level is invalid. Line 1, position 1

xml.LoadData - Data at the root level is invalid. Line 1, position 1 I'm trying to parse some XML inside a WiX installer. The XML would be an object of all my errors returned from a web server. I'm ge...

1 Oct at 17:39

Repairing wrong encoding in XML files

Repairing wrong encoding in XML files One of our providers are sometimes sending XML feeds that are tagged as UTF-8 encoded documents but includes characters that are not included in the UTF-8 charset...

19 Oct at 19:59

How to write a Parser in C#?

How to write a Parser in C#? How do I go about writing a Parser (Recursive Descent?) in C#? For now I just want a simple parser that parses arithmetic expressions (and reads variables?). Though later ...

13 Oct at 01:47

Can you preserve leading and trailing whitespace in XML?

Can you preserve leading and trailing whitespace in XML? How does one tell the XML parser to honor leading and trailing whitespace? Above prints out 3. ``` Dim xml: Set xml = CreateObject("MSXML2.DOMD...

5 Jan at 22:2

Options to override/reconfigure ServiceStack.ServiceModel.Serialization.DataContractDeserializer

Options to override/reconfigure ServiceStack.ServiceModel.Serialization.DataContractDeserializer We are currently re-writing a legacy system and have been using ServiceStack for a multitude of reasons...

TouchXML - CXMLDocument object failed to initialize

TouchXML - CXMLDocument object failed to initialize I am stuck with some TouchXML code. Please help. I have the following code to get the data from an xml webservice: ``` NSData *urlData = [NSURLConne...

jQuery XML error ' No 'Access-Control-Allow-Origin' header is present on the requested resource.'

jQuery XML error ' No 'Access-Control-Allow-Origin' header is present on the requested resource.' I am working on this personal project of mine just for fun where I want to read an xml file which is l...

Parsing XML file using C#?

Parsing XML file using C#? I'm new to both XML and C#; I'm trying to find a way to efficiently parse a given xml file to retrieve relevant numerical values, base on the "proj_title" value=heat_run or ...

3 Jun at 16:51

Parsing a YAML file in Python, and accessing the data?

Parsing a YAML file in Python, and accessing the data? I am new to YAML and have been searching for ways to parse a YAML file and use/access the data from the parsed YAML. I have come across explanati...

23 May at 12:2

Parsing XML with namespace in Python via 'ElementTree'

Parsing XML with namespace in Python via 'ElementTree' I have the following XML which I want to parse using Python's `ElementTree`: ```

Line Break in XML?

Line Break in XML? I'm a beginner in web development, and I'm trying to insert line breaks in my XML file. This is what my XML looks like: ``` Song Title Lyrics Song Title Lyrics ...

6 Jun at 23:30

How to change XML attribute on the client side and then save the result on the server side?

How to change XML attribute on the client side and then save the result on the server side? My Question is : I read a xml file from server side and then present them into client side, next I want to e...

28 Mar at 17:51

Read XML file as DataSet

Read XML file as DataSet I am inexperienced with parsing XML files, and I am saving line graph data to an xml file, so I did a little bit of research. According to [this](http://csharptutorial.blogspo...

19 Jan at 07:34

Java parsing XML document gives "Content not allowed in prolog." error

Java parsing XML document gives "Content not allowed in prolog." error I am writing a program in Java that takes a custom XML file and parses it. I'm using the XML file for storage. I am getting the f...

8 Apr at 13:23

How to prevent XXE attack (XmlDocument in .NET)

How to prevent XXE attack (XmlDocument in .NET) We had a security audit on our code, and they mentioned that our code is vulnerable to EXternal Entity (XXE) attack. I am using following code - ``` str...

19 Apr at 18:34

Extract SOAP body from a SOAP message

Extract SOAP body from a SOAP message I want to extract SOAP body from a SOAP message, I have some data in SOAP body that I have to parse in date base, so this is the code: ``` public string Load_XML(...

18 Apr at 14:55

C# XPath Not Finding Anything

C# XPath Not Finding Anything I'm trying to use XPath to select the items which have a facet with `Location` values, but currently my attempts even to just select all items fail: The system happily re...

31 Dec at 11:16

Loop through all elements in XML using NodeList

Loop through all elements in XML using NodeList I want to loop through all elements in a piece of XML printing each one. My problem is that I keep getting a null pointer exception after the `staff1` t...

28 Jan at 17:28

org.xml.sax.SAXParseException: Premature end of file for *VALID* XML

org.xml.sax.SAXParseException: Premature end of file for *VALID* XML I am getting very strange "Premature end of file." exception for last few days on one of our servers. The configuration XML works f...

20 Nov at 20:25

UnicodeEncodeError: 'ascii' codec can't encode character u'\xef' in position 0: ordinal not in range(128)

UnicodeEncodeError: 'ascii' codec can't encode character u'\xef' in position 0: ordinal not in range(128) I want to parse my XML document. So I have stored my XML document as below Now my below is my ...

XML Parsing - Read a Simple XML File and Retrieve Values

XML Parsing - Read a Simple XML File and Retrieve Values I've written a Task Scheduling program for learning purposes. Currently I'm saving the scheduled tasks just as plain text and then parsing it u...

21 Feb at 19:25

'xsi' is an undeclared prefix using XmlDocument

'xsi' is an undeclared prefix using XmlDocument I am receiving 'xsi' is an undeclared prefix using XmlDocument. I am trying to read a file which has the following schema: ```

18 Dec at 15:59

C# extracting data from XML

C# extracting data from XML I'm trying to read weather data from XML in a URL. The XML looks like this: ``` ... ... ... ... ...

14 Jul at 18:42