[web-devel] Fwd: DTD types
gale at sefer.org
Thu Jun 2 06:56:27 CEST 2011
Sorry, forgot to include the list as a recipient.
---------- Forwarded message ----------
From: Yitzchak Gale
Date: Wed, Jun 1, 2011 at 10:50 AM
Subject: Re: DTD types
To: John Millikin
>>>> For example, I couldn't use name, because for DTD namespaces
>>>> *are* significant so they need a different Eq instance. I ended up
>>>> just using Text."
John Millikin wrote:
>>> I don't understand what this means; the xml-types Eq instance
>>> for Name compares both the namespace and local name
>> Ah, OK. I misunderstood the docs - it says that the "prefix"
>> is not used in the Eq instance, so I took that to mean
>> that namespaces prefixes were not used.
> Lets say you have a document like this:
> <foo:doc xmlns:foo="http://my/namespace/here">bar</foo:doc>
> The name of the element will have the components:
> prefix = "foo"
> namespace = "http://my/namespace/here"
> local name = "doc"
> The prefix is not semantically important; all names are identified by
> the (namespace, local name) pair. Thus, comparing two names ignores
> the prefix.
Hmm. Then I was right in the first place. I can't use the
xml-types Name type for DTDs. The XML Namespaces
"Note that DTD-based validation is not namespace-aware in the
following sense: a DTD constrains the elements and attributes
that may appear in a document by their uninterpreted names,
not by (namespace name, local name) pairs."
So in the DTD, the prefix *is* semantically significant.
And Clark notation is irrelevant, because there is no use
for the URI in the DTD.
I already uploaded a new version of dtd-types, 0.1.0.0,
to Hackage, with a number of fixes, including using
Name in a few places. Before I announce, I'm going
to have to remove Name and uploaded another version.
More information about the web-devel