NYCPHP Meetup

NYPHP.org

[nycphp-talk] Is this XML valid?

David Krings ramons at gmx.net
Sat Sep 19 06:34:07 EDT 2009


David Roth wrote:
> I've been using simplexml to parse XML and so far the XML I've had to 
> deal with has been pretty straight forward. Then I run across this XML 
> which I don't know what to call it or how it should be handled properly.
> 
> Here is a fragment of what I'm talking about:
> 
> <?xml version="1.0" ?>
> <document type="db download">
> 
> <packages total_weight="15.8" total_packages="1">
> <package length="147" width="5" height="5" weight="15.8"/>
> </packages>
> 
> I was expecting each attribute and node to have it's own <> and </>, and 
> the data not to be surround by double-quotes or am I missing something?
> 
> Thanks!
> 
> David

I am not an XML expert, but yes, I would too expect opening and closing tags 
for everything, be it as <some_tag..../> or as <some_tag><some_tag/>. I don't 
see anything wrong with the quotes and think they have to be there.


David



More information about the talk mailing list