Menu

#7 bugreport: <?xml> attributes in wrong order (XML-Mini 1.2.8)

open
nobody
None
5
2003-12-03
2003-12-03
No

The <?xml> tag has a required order for the possible
attributes,
version
encoding
standalone
And they are required to be in this order in order for
this tag to be in a valid format for strict XML 1.0.

However, Mini-XML treats this tag as though it were an
ordinary XML tag and puts these attributes in
alphabetical order.
When you validate the XML document through a strict XML
validator you get an error of the attributes not being
in the correct order.

Consider the following:

$header->attribute("version","1.0");
$header->attribute("encoding","UTF-8");
$header->toString();

the above will produce:

<?xml encoding="UTF-8" version="1.0"?>

this is invalid XML.
The correct format should be:

<?xml version="1.0" encoding="UTF-8"?>

-RG

Discussion


Log in to post a comment.