Serializing xml nodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Serializing xml nodes

evert (Bugzilla)
Hi guys,

I'm working on a WebDAV implementation, and for convenience i'd like  
to serialize the full xml namespace + tag name into a single string.

So far I've used:

DAV:#resourcetype

But, I realize this isn't ideal because XML namespaces can contain the  
#. I've seen some WebDAV use :

{DAV:}resourcetype

Would this be the preferred serialization method?

Evert


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Serializing xml nodes

Julian Reschke

Evert | Rooftop wrote:

> Hi guys,
>
> I'm working on a WebDAV implementation, and for convenience i'd like to
> serialize the full xml namespace + tag name into a single string.
>
> So far I've used:
>
> DAV:#resourcetype
>
> But, I realize this isn't ideal because XML namespaces can contain the
> #. I've seen some WebDAV use :
>
> {DAV:}resourcetype
>
> Would this be the preferred serialization method?
> ...

Indeed.

This is the format proposed by Jim Clark a long time ago, so sometimes
it's called "Clark Notation". It's also used in quite a few APIs that
use namespace/localname pairs as identifiers, such as in SAX or in JCR 2.0.

BR, Julian