php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #28452 XML documentation unclear
Submitted: 2004-05-20 07:54 UTC Modified: 2004-05-21 11:08 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: prof_moriarty at veryfast dot biz Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: 5.0.0RC2 OS: Win XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 + 44 = ?
Subscribe to this entry?

 
 [2004-05-20 07:54 UTC] prof_moriarty at veryfast dot biz
Description:
------------
Forgive me for being obtuse, but i've been staring at the XML documentation for parsing XML files into PHP for what seems like rather too long, and i still havn't got the foggiest what is going on.
I'm not a newbie to PHP (been deving with it for 3+ years), but i am new to XML.

My problems seem to revolve around the fact that none of the examples are all that clear. There isn't a simple way to parse a file (xml_parse_into_struct is there, but the documentation doesn't actually say anything about what makes the parallel arrays parralel! (i.e. why there are 2 arrays rather than 1).

Worst of all is xml_parse.
It's not all that clear how to use this function. I know it parses stuff. However it's not made clear what is required for it to be succussful. If i just run:

xml_create_parser(args);
xml_parse(args);
xml_free_parser(args);

i get nothing. I doubt i'm supposed to just run those 3, however without being told what to run, what am i supposed to do try every combination of all the xml functions until i get something? :) 

And before you say it's just me, there are at least 2 comments on the ref-XML page that explicitly how unclear things are, as well as a few others that infer such things.


I'll try explaining it another way:
Many functions within SE (and hence explanations in the docs), are stand-alone. i.e They don't generally require other functions to work.
array functions, string functions, maths functions etc, etc.

However for things like XML, MySQL, File handling, dir handling etc, they are all interelated.
i.e., i can't use mysql_query, without first using mysql_db_connect and then mysql_db_select.
Generally the examples for these inter-related functions are clear, however, i've seen tar that is clearer than the explanations of how to use the XML functions together. :)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-20 07:55 UTC] prof_moriarty at veryfast dot biz
changed category. wrong one. :/
 [2004-05-21 07:25 UTC] chregu@php.net
There are at least 3 examples on http://php.net/manual/
en/ref.xml.php about how to parse an XML document with 
ext/xml. 

If that's not enough, there are tons of articles and 
books about XML and PHP. Google's your friend.

Thanks for your time
 [2004-05-21 11:08 UTC] prof_moriarty at veryfast dot biz
I _KNOW_ there are 3 examples on xmlref. it's to those that i was alluding.
It's just that they arn't particularly clear. I ran the first two several times, and couldn't figure out what the heck was going on. :)

I still don't know what happens to the results from XML_parse function. or how to access them. Even though i've written an XML parser now (using the XML_parse_into_struct functions (and i still don't know what the second "index" array is for that's produced by that function. i only used the first one!).
Doesn't that tell you that something somewhere is lacking? Either that or i'm rubbish. but seeing as most other documentation has proven understandable, it must just be something about the XML section. ;)

And:
"When I first read this documentation, and tried the examples none of which seemed to work."
Posted just 8 days ago, to the same ref.xml that you refered me to!
so as i said, it's not just me.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 22 04:01:26 2019 UTC