Closed Thread Icon

Topic awaiting preservation: [PHP and c(++)] xml tutorials and questions (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=24154" title="Pages that link to Topic awaiting preservation: [PHP and c(++)] xml tutorials and questions (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: [PHP and c(++)] xml tutorials and questions <span class="small">(Page 1 of 1)</span>\

 
ninmonkeys
Nervous Wreck (II) Inmate

From: mn
Insane since: May 2004

posted posted 11-23-2004 07:03

I'm looking forward to learning to use XML and PHP or C++.

1) Could you recommend any xml tutorials? I'm sort of new to XML itself, but I think I understand it. What I would like to find is tutorials on reading/writing xml files with PHP or C++.

2) What is expat? Is it something that should be avoided? (quote: This toolkit lets you parse, but not validate, XML documents.

3) What is this DOM vs expat thing? (I think expat is the one where when it runs into a tag, it calls a function, while DOM loads the whole file tree-like into memory) Why choose expat over DOM or vise versa? Is it depending if you need speed, or if you would rather have easier/clearer code?

4) A tutorial I'm reading uses DOM to read XML: http://www.phpbuilder.com/columns/matt20001228.php3?page=1 But I don't find the functions on php.net Is it a module? I thought it wasn't because on the first page it says you need to compile PHP with dom (which my configure does have that flag), so why doesn't it have the doc's on the function xmldocfile() ?

thanks for the help,
--monkey

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 11-23-2004 07:18

I can't personally recommend any tutes though I'm sure there is plenty

Expat is the Parser of choice for parsing XML documents. Essentially it's a C program installed that other languages use to "parse" XML documents. In other words it reads the document and does certain things with the data it retrieves. You can't really avoid it and shouldn't try. Using expat should be a transparent process.

Validating a document means checking to make sure the XML document is well formed. Expat does not validate an XML Document (it fails if the document is not well formed).

DOM is the Document Object Model. It doesn't really have anything to do with Expat. The DOM is a way to traverse the Data you have in the XML document.

Expat is designed to read an XML stream, In other words not necessarily a complete XML document. It reads the data as it comes in and calls certain functions baseed on certain criteria. This is a good method for extremely large data sets. DOM is good for small complete documents because it works on the complete data set.


Check this out regarding the XMLDOM functions



.:[ Never resist a perfect moment ]:.

« BackwardsOnwards »

Show Forum Drop Down Menu