homepage Welcome to WebmasterWorld Guest from 23.22.29.137
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
How to Parse an XML Document?
sugath




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

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




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

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




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

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




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

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




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

>> 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




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

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




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

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




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

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

macrost




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved