Web Design and Development Forums

easiest way to parse xml

This is a discussion on "easiest way to parse xml" within the XML, RSS & Atom section. This forum, and the thread "easiest way to parse xml are both part of the Program Your Website category.

Old Aug 30th, 2007, 08:17   #1 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
easiest way to parse xml

hey what's the easiest way to parse xml?
JS, PHP, XSL or something else?
cheers!
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Aug 30th, 2007, 09:40   #2 (permalink)
Up'n'Coming Member
 
Join Date: Aug 2007
Location: Bicester
Posts: 70
Re: easiest way to parse xml

Alex

Perl supports XML with several modules. XML::Parser and libxml are the two main ones. libxml is the newer one and supports XPATH.

PHP 4 supports XML but it uses the same c library that the older Perl XML::Parser uses. PHP 5 offers better support and uses the same c library that Perl libxml uses. PHP 5 supports XPATH (I am not sure about PHP 4).

Here is some sample Perl code:

Code: Select all
 
use strict;
use XML::LibXML;

my $file = 'myfile.xml';
my $parser = XML::LibXML->new();
my $tree = $parser->parse_file($file);
my $root = $tree->getDocumentElement;#gets top element
my @species = $root->getElementsByTagName('species');
#@species is now list of all tags with name 'species'.
So: it really depends on what langauge you are already using.

As far as Javascript goes; the browsers offer an XML object which you can script with Javascript. In Internet Explorer it is the xmldom object.

XSLT (I can tell you are a beginner) is not an XML parser language. It is about transforming XML documents. A typical use is to transform XML from a database into XHTML for the web.



Justin
Kropotkin is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Aug 30th, 2007, 14:44   #3 (permalink)
Administrator
 
alexgeek's Avatar
 
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 4,102
Blog Entries: 9
Send a message via MSN to alexgeek
Re: easiest way to parse xml

try it out soon then.
thanks
__________________
Languages: PHP, mySQL (queries), C#, (X)html, CSS, JS.


alexgeek is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
method, xml

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Easiest way to open database connection! Monie MSSQL & Access 4 Nov 1st, 2007 07:35
easiest filter alexgeek PHP Forum 16 Aug 24th, 2007 15:44
What is a Parse Error? rubyfruit New to Web Design 1 Jul 5th, 2007 20:40
Easiest way to convert from tables to CSS aod2002 HTML Forum 17 Mar 11th, 2007 01:33
Parse Error Maverick25r PHP Forum 4 Sep 15th, 2006 16:55



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 21:42.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59