[thelist] xml scema confusion

Matt Warden mwarden at gmail.com
Sat Jul 4 13:12:29 CDT 2009


On Fri, Jul 3, 2009 at 3:31 AM, Simon Watkins<handymanorama at gmail.com> wrote:
> <?xml version="1.0" encoding="utf-8"?>
> <locations>
>    <location>
>        <placename>Somewhere</placename>
>        <latitude>50.123456</latitude>
>        <longitude>-2.123456</longitude>
>    </location>
...
>  Each location must have a placename, and can optionally have a latitude and
> longitude.  Obviously if it has one it has to have the other. It seems
> logical to me to validate it against something like this, which has a choice
> of a sequence, or merely an element:

I'm guessing you aren't able to change the XML structure, right? The
real problem is that the combination of lat+long is a single element
of a location in this context, describing its point on the coordinate
map. The XML above indicates they are two different elements, and
that's why you're having trouble.

Would suggest:
location > placename
location > coordinatepoint > latitude
location > coordinatepoint > longitude

Then, placename is required, coordinatepoint is optional, latitude and
longitude are required.

-- 
Matt Warden
Cincinnati, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.



More information about the thelist mailing list