[XML-SIG] Looking for namespace examples...

Lars Marius Garshol larsga@ifi.uio.no
19 Apr 1999 10:13:04 +0200


* Greg Stein
| 
| [ns & validation] The only workaround is to use a default namespace
| for the WHOLE document so that the DTD refers to <bar/> and the
| document uses <bar/> (and the element in the doc falls into the
| appropriate namespace via an xmlns="..." attribute). Note that this
| implies only one namespace per document.

You can also use FIXED attribute declarations and, by implication,
always use the same prefix for the same namespace. This essentially
leaves you with the first Namespace WD, although in a different syntax.
 
* Stuart Hungerford
|
| I've seen short examples where the xmlns:foo attribute is defined as
| a FIXED attribute (in David Megginson's "19 questions" document),
| and now I'm a bit confused.
 
* Greg Stein
|
| I'm not familiar with DTD terminology, so I don't know what FIXED is
| attempting to state.

That the element will always have the attribute with the specified
value, whether the user bothered to explicitly add it in the document
or not.
 
| Hopefully the two docs above will provide ample information. I posted a
| module to this list a couple weeks ago which will properly and quickly
| parse XML documents with namespaces (I don't believe the xml package has
| a parser/DOM capable of doing so, although it appears Python's xmllib.py
| can (albeit slowly)). 

Both xmllib and xmlproc can handle namespaces. In xmlproc this
requires you to use an extra module, which comes with the parser.

--Lars M.