NYCPHP Meetup

NYPHP.org

[nycphp-talk] Is this XML valid?

lists at nopersonal.info lists at nopersonal.info
Sat Sep 19 12:42:29 EDT 2009


David Roth wrote:

> <?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?

XML attributes must be quoted, but you can use either double or single
quotes. If there's nothing between the opening & closing tags you can
use the shorthand tag, just as you would with <img src="foo.gif" /> or
<br />.

http://www.tizag.com/xmlTutorial/xmltag.php
http://www.tizag.com/xmlTutorial/xmlattributes.php

Bev




More information about the talk mailing list