[gmx-developers] libxml2

Teemu Murtola teemu.murtola at gmail.com
Thu Nov 21 21:08:51 CET 2013

Hi all,

again, some mostly technical comments.

On Mon, Nov 18, 2013 at 5:23 PM, Mark Abraham <mark.j.abraham at gmail.com>wrote:

> Looks like a good start! Thanks.
> I'm not sure whether <gromacs xmlns:gmx="http://www.gromacs.org/schemas">
> should name a schema file, or a place to look up a schema file. Does anyone
> know?

As Erik said, it's just a string with no direct semantics. And there is no
strict correspondence between schemas and namespaces, either. I'm not an
expert on this, but at least it is possible to have multiple schemas that
all declare parts of the same namespace, and composite schemas created from
these. A single schema can also reference multiple namespaces (but must in
such a case import schemas for the other namespaces). And the location of
the schema is often declared using a separate attribute
(xsi:schemaLocation, with suitably defined xsi:), separately from the
namespace. Don't know exactly what kind of look-up rules different parsers
use for the schema locations.

If we want to publish the schemas on the web page, we also need to consider
versioning. What is going to happen if, say, Gromacs 6.0 needs to change
these schemas somehow? If we just replace them on the web page, earlier
files are going to break. It's unrealistic to assume that we can design
something that is going to remain static forever, in particular if we start
from a corner like this instead from a central concept like the topology

For the units, I don't have a strong opinion, but do we really want to
implement a mini-language that we then must parse and validate to be able
to specify arbitrary units and arbitrary unit conversions, and force the
users to type them everywhere? One simple alternative would be to just
encode the expected unit in the name of the element.

In the past I have seem XML files with namespace-specific content like
>   <gmx:sfactors type="Fourier" force_field="any" displaced_solvent="true"
> reference="">
>     <gmx:sfactor residue="ALA" atom="MW" type="1">
> which I'm sure we'd like to avoid. Does David's suggestion achieve that?

It doesn't. It declares that anything prefixed with gmx: is in the given
namespace, but doesn't actually use that prefix for anything. If you want
to declare that unqualified elements go into a specific namespace, you need
to use xmlns="…".

Just my two cents,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20131121/2651d46a/attachment.html>

More information about the gromacs.org_gmx-developers mailing list