[webservices] A question of location ID, how to represent empty IDs in XML?

Joachim Saul saul at gfz-potsdam.de
Mon Jul 28 07:18:39 PDT 2014


Hi Lion,

Lion Krischer [07/28/2014 03:54 PM]:
> ^([A-Z0-9]{2}|  )$
>
> It matches “AA”, “00”, “10”, “A1”, “  “ , …
> but not “—“, “”, “-“, “a1”, ...

'Not ""' is a problem as "" is a valid location code according to SEED 
specification. Which is what all this is actually about. :)

In general I like the idea of using regular expressions if we use 
^([A-Z0-9]{2}|  |)$

> Everything else will get rejected. Then one can be sure that it is consistent everywhere (assuming people test their web services against the schema which is a good idea in any case). Similar regexes should also be defined for the network, station, and channel codes to assure compatibility with SEED. In general it would be a good idea to have the schema enforce as many things as possible and leave little to no room for interpretations.
>
>
> Now whether one uses two spaces, two dashes, an empty string or what not for an empty location code does not really matter. All are syntactically valid XML and thus any parser can be expected to be able to deal with them. Consistency is by far the most important thing in my opinion.

The most important consistency is with the SEED standard.

Cheers
Joachim



More information about the webservices mailing list