Welcome to WebmasterWorld Guest from 54.226.25.231

Forum Moderators: httpwebwitch

Message Too Old, No Replies

How to Parse an XML Document?

     

sugath

8:39 pm on Nov 4, 2003 (gmt 0)

10+ Year Member



first thing what does parsing an XML document means
Why it is used
How to Parse an XML document ...

I know how to work with XML tags ... i mean just started and can write a simle XML document /
what are other things one should know about XML as a web master ...

thanks

korkus2000

8:43 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Depends on what you need. To parse an XML document is to extract and read the information contained in that document. You can do this with server-side code like PHP or ASP. You can also use the XML stylesheet language XSL.

As a webmaster you may never have the need to use XML, but a lot of technology does use it. RSS feeds like the one dmoz uses to do a database dump is XML. It really depends on your goals technically.

sugath

9:02 pm on Nov 4, 2003 (gmt 0)

10+ Year Member



i think XML was designed to describe the data and focus on what the data is ....it is widely used to structure, store and send information ...

when information is stored in XML we need to read that document .......... that is done through parsing ...
i wanted to know how it is done ... what xml objects are used to do that .....
i mean how is generally parsing done to read the huge documents and display it ../

thanks

Imaster

9:09 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is an interesting question. I have often felt the need to parse XML documents, but I don't have a good XML background. Are there any good softwares available which take care to parse the xml documents in our desired format.

lorax

9:26 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



>> think XML was designed to describe the data

Precisely.

>> Why it is used

To make data portable independent of the medium that delivers it.

>> what are other things one should know

xml.com
oasis-open.org/cover/
oreilly.com

XML
SGML
Schemas
XSL/XSLT/XPath
XLink
XML Query
CSS
SVG

and about a hundred of ongoing projects [xml.coverpages.org]

How you parse is up to you. There are function libraries available for each of the major scripting languages (I know PHP has it and I'd guess ASP and CFML has it as well).

aspdaddy

9:31 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Another way to read xml is to bind the xml data to an html table, using client side script.

See #7 for an example
[webmasterworld.com...]

MonkeeSage

9:44 pm on Nov 4, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



when information is stored in XML we need to read that document .......... that is done through parsing ...
i wanted to know how it is done ... what xml objects are used to do that .....
i mean how is generally parsing done to read the huge documents and display it ..

Basic XML structure is...

<root> 
<children />
<children />
<children>
<subchildren />
</children>
...
</root>

Basic idea of parsing is to break the markup into a Document-Object Model (DOM) containing the various parts and their attributes, relationships, &c. This DOM can then be queried to get the various informations.

What is commonly meant when people talk about an 'XML parser' is just an engine that reads in an XML file and tries to build a DOM from it in a format that is accessible from whatever program is calling it, e.g., Xerces.

As mentioned, XSLT / XPath as well as PHP and other scripting languages, are are usually the programs used to query the DOM that was constructed by the parser. Depending on the programmer, the information that was retreived is then displayed in some common format such as XHTML + CSS, or PDF.

Jordan

korkus2000

1:57 pm on Nov 5, 2003 (gmt 0)

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



This thread may help:
[webmasterworld.com...]

macrost

2:50 pm on Nov 5, 2003 (gmt 0)

10+ Year Member



Korkus,
Great thread there! (The last post btw) I have been actively using xml/xsl/asp for about 2 years now, and have to say I love it totally.
Why it is used

Basically XML can be thought of as a container for data that then can be transferred between two systems.
How to Parse an XML document

I personally work with ht*p://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000438 (click on msxml -> sdk documentation -> and either msxml 4.0 or 3.0) for all of my parsing and transforming needs. I tend to use XSL to transform my data, instead of parsing with classic ASP.

Have fun! I do! ;)

Mac

 

Featured Threads

Hot Threads This Week

Hot Threads This Month