Jeroen Breedveld wrote: > The working draft states nothing about how to a specifiy namespace uri. > In the uses case I did this: > > <xupdate:insert-after xmlns:addressX="http://www.xmldb.org/address2" > select="/addresses/addressX:address"> > <address name="Jan"> > <town>Las Vegas</town> > </address> > </xupdate:insert-after> > > I this a logical thing to do? Does it conform for example with what XSLT > does? Can anyone think of another way? What are the consequences for the > DTD? Is validation (still?) a possibility? Any thoughts?
I don't know how XSLT implements namespaces, but you really have two choices on how to do them: 1) Use xmlns attributes, like you did. The advantage of this is that it is a standard mechanism, so it can be understood by generic code. It also (theoretically) means that you can cut and paste XML document fragments and carry the namespace information with the fragement. 2) Use an XUpdate-specific element, such as the following: <xupdate:namespace prefix="rpb" uri="http://www.rpbourret.com/ns/" /> Languages that use such elements usually require them to be at the start of the document in order to simplify processing. While less rich than xmlns attributes, these elements are also much easier to understand. The major disadvantage is that you now have two separate sets of namespace declarations, which might confuse some users. (Then again, it might be clearer to others...) For what it's worth, this is the option I use in my mapping languages. In neither case can you validate against a DTD, since XUpdate allows for arbitrary elements. In both cases, you can validate against XML Schemas and RELAX NG, as both languages allow for arbitrary elements. -- Ron ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact administrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------