Java: Writing XML files - V1.0 vs V1.1

Discussion in 'Mac Programming' started by wrldwzrd89, Apr 12, 2009.

  1. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #1
    This has got me completely baffled. If I make an XML 1.0 file, like so:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <test>
    <integer len="1">3</integer>
    <string len="5">Blah!</string>
    <string len="25"><>&&apos;"</string>
    <double len="5">293.0</double>
    </test>
    ... and run it through an XML validator, it validates. However, I would like to use XML V1.1, by making a simple change: 1.0 becomes 1.1, like so.
    Code:
    <?xml version="1.1" encoding="UTF-8"?>
    <test>
    <integer len="1">3</integer>
    <string len="5">Blah!</string>
    <string len="25"><>&&apos;"</string>
    <double len="5">293.0</double>
    </test>
    If I run this through the validator, it tells me that my XML declaration isn't well-formed, and the error is on column 16 of line 1. What is making it invalid?
     

Share This Page