OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Namespace vs Prefix in error message: friendly versus corr

[ Lists Home | Date Index | Thread Index ]



Uche Ogbuji wrote:
> 
> Jeff Lowery:
> 
> > c) Batik Squiggle 1.5b noted that "the attribute xlink:href of the element
> > <image> is required", which is kind of a curious error since 1) xlink is a
> > prefix, not a namespace; 2) the namespace declaration itself was invalid,
> > yet didn't cause an error (in any of the programs)
> 
> ...
>
> I've actually thought that I should switch from Python tuple notation to
> Clark's notation:
> 
> "Element {http://www.w3.org/1999/XSL/Transform}when cannot appear here"
> 
> Anyway, I wanted to get the perspective of othr XML-DEVvers on this trade-off.
> 

it depends on the perspective offerred by your interfaces, but i would think
it suboptimal to have to work with prefixes.

in cl-xml names are most readily expressed as universal names in clark
notation. for example

 (dolist (element (./* *some-element* '{some-namespace}name))
    ...)

would iterate over the designated elements. that is, programmes are written in
terms of universal names only and prefixes never appear. except for the
temporary qualified names attached to dtd components during interning, _all_
names in data structures are modeled as universal names.

given this, it is appropriate that any error messages should also present
names in the same form. which means that the print-object method for universal
names generates expressions of this form and the reader recognizes clark
notation for universal names. if symbols are used rather than name instances,
the printed form is the customary <package-name>::<symbol name> which is the
same information with a different syntax.

names can, in fact, drag their most recently used prefixes around with them,
and there are interfaces which would let one do things like
  (let ((name (make-instance 'uname
                             :namespace (prefix-namespace some-prefix)
	                        :local-part local-part)))
     (dolist (element (./* *some-element* name))
       ...))

,but the only place that happens is within the parser itself in the dynamic
context of a document, and the only time i ever looked at prefixes was when
using the debugger while implementing dtd interning and serialization.

this may not be your typical perspective, but from the perspective of a closed
document model, the prefixes really don't have much meaning and don't belong
in most messages.

...




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS