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

Chad Trabant chad at iris.washington.edu
Thu Jul 31 00:42:29 PDT 2014


On Jul 31, 2014, at 12:33 AM, Joachim Saul <saul at gfz-potsdam.de> wrote:

> Chad Trabant wrote on 31.07.2014 08:49:
>>> In terms of existing StationXML parsers I assume most are just stripping whitespaces from the location code and thus “”  and “  “ should already work resulting in minimal disruption in the users’ workflows.
>> 
>> Actually, this does not appear to be happening, in the parsers I’ve used the whitespaces are not stripped.  I have read through the XML specifications until my eyes were crossed to try and understand why this would be the case.  Then I wrote some test cases and observed no trimming, see test data and code below.  Perhaps this attribute is CDATA for some reason?  I think we are stuck with the fact that empty string and two spaces are different.
> 
> There may be parsers that do strip whitespaces, but I also doubt that this is required by any standard.
> 
>> Has anyone observed this automatic trimming on any system?
> 
> No, and I agree that a generic parser should return a raw string as it is in the XML without implicit trimming, nullifying etc. To obtain a trimmed string, it's trivial to trim() the input strings as needed. That's what's done in ObsPy, too.
> 
> In fact even the *already* empty string location codes from libmseed are trimmed again at ObsPy level, just in case. ;)

HI Joachim,

You keep coming back to this as if it is meaningful.  libmseed and the parts of ObsPy getting information from libmseed are dealing with SEED data, where the current rules of parsing are clear.  What is your point exactly?

>>> “--“ would require software to be updated and looks a little bit weird in my opinion and unsuspecting users might interpret it as an invalid location code.
>> 
>> Yes, it would require software changes, the question is would what we gain be worth it.  Maybe it looks a little weird, but it is already becoming synonymous in the minds of many because "--" is used for *selecting* the empty SEED location IDs.
> 
> The software changes are just one aspect. In fact, software changes are trivial compared to the nightmare of changing the existing metadata in databases, decades of SEED data, parametric data and so on.

Why do you think the existing metadata and decades of SEED would need to be changed?  Please explain.

Chad




More information about the webservices mailing list