Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does parsing XML mean? [closed]

Tags:

Can someone please explain to me what parsing XML means? And what does an XML parser do in general?

like image 974
dwyane Avatar asked Feb 28 '11 10:02

dwyane


People also ask

What does parsing mean in XML?

Definition. XML parsing is the process of reading an XML document and providing an interface to the user application for accessing the document. An XML parser is a software apparatus that accomplishes such tasks.

What causes XML parsing error?

The most common cause is encoding errors. There are several basic approaches to solving this: escaping problematic characters ( < becomes &lt; , & becomes &amp; , etc.), escaping entire blocks of text with CDATA sections, or putting an encoding declaration at the start of the feed.

How is an XML document parsed?

To parse XML documents, use the XML PARSE statement, specifying the XML document that is to be parsed and the processing procedure for handling XML events that occur during parsing, as shown in the following code fragment.


1 Answers

It means "reading" the XML file/string and getting its content according to the structure, usually to use them in a program.

For example if you have this XML fragment:

<root>     <node1>value1</node1>     <node2>value2</node2> </root> 

you may want to use these values in a data structure:

ClassRoot:     node1: string     node2: string 

so that, in the end:

Object goofy = ClassRoot.new parse(xml, goofy) puts(goofy) 

yelds something like:

goofy[node1='value1'; node2='value2'] 

There are many ways of doing so, like DOM or SAX. You might want to investigate XSLT and xpath as well, according to your needs.

like image 166
Manrico Corazzi Avatar answered Oct 21 '22 17:10

Manrico Corazzi