Re: PULL Parser in PHP

Aleksander Slominski <[email protected]>
Newsgroups gmane.text.xml.xmlpull.devel
Message-ID <[email protected]>
lrargerich wrote:

> I find the initiative of xmlpull.org quite ineteresting, as an
> excercise I'm implementing an XML-PULL parser in PHP, I'll point to
> the code/documentation as soon as I have it ready so you can test it
> or comment about it.

hi,

that is fantastic!

> The API will be respected except when PHP doesn't let me, for example
> I can't overload methods so I created
> getAttributeValueByName($namespace,$local-name) and
> getAttributeName($index) as two different methods. Is there an API for
> non-overloading languages? :-) I guess not.

actually API is generally very simple and it not much more than methods
in one XmlPullParser interface.

there are only two overloaded methods: getAttributeName and getNamespace
    (1) public String getNamespace ();
    (2) public String getNamespace (String prefix);
    --> getNamespaceFromPrefix
   (3) public String getAttributeValue(int index);
   (4) public String getAttributeValue(String namespace, String name);
   ---> getAttributeValueFromName
and i think to add maybe to next version those two methods
(getNamespaceFromPrefix and getAttributeValueFromName)
and to deprecate overloaded methods (2) and (4) but not to
remove them until next major release of XMLPULL API (V2).

i was thinking about providing C/C++ version of API soon however i have
never sorted out how to handle exceptions in C, how to get nice IO and finally
what is best representation for String in C (use wchar_t or char but point that it
is UTF8 encoded). how did you approach it on PHP, what were other
changes to API that you have to do?

thanks,

alek
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.