How do XML NameSpace aware processors react to NS definations?
Ronald Bourret
rbourret at ito.tu-darmstadt.de
Thu Nov 19 09:23:52 GMT 1998
Amit Rekhi wrote:
> Ronald Bourret wrote:
>
> > If by "validating the namespaces" you mean checking that the prefix
used in
> > the element or attribute name has been declared, it seems more
appropriate
> > that if the parser claims to be namespace-aware, it would perform this
> > task. Similarly, if the parser was a validating parser, it would also
do any validation.
>
> Assuming that the parser is a validating NS aware parser,
> I was wondering what other validations could the parser perform.
>
> * It would be difficult for the parser to validate the content model,
> attributes of all the prefixed names against their definations in the DTD
> since the Namespace URI only signifies a unique identifier, nothing
more.So
> validating prefixed names in the way given above would be difficult.
> Am I right?
> Then what other validations are left which are relevant to namespaces?
You are confusing two different things: validation (meaning to enforce the
validity constraints in the XML spec) and enforcing the namespace
constraints in the namespaces spec. These are completely independent of
each other.
The program that processes the namespaces must enforce the namespace
constraints. Generally, this will be the parser or a layer (such as John
Cowan's namespace parser filter) built on top of the parser. In the case of
a namespace-aware, validating parser, the parser enforces this.
The program that performs validation enforces the validity constraints.
This is usually a validating parser. This program gets the information to
validate against from the DTD. It gets the DTD from the DOCTYPE statement;
the DOCTYPE statement always points to the DTD, regardless of whether
namespaces are used or not. As you point out, the parser does not get the
DTD from the namespace URI; the namespace URI is just a unique identifier
and does not necessarily point to anything.
-- Ron Bourret
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev
mailing list