You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by John Hall <jo...@evergo.net> on 2001/03/19 23:55:40 UTC
Newbie. Default Namespace dosen't work? WebDav.
My company is using Xerces 1.2.3 (J) for its XML parser. We are
implementing WebDav.
The parser calls my function when a new element is encountered:
startElement( String p_namespaceName, String p_localName, String raw,
Attributes p_attrs)
When I use the following XML:
<?xml version="1.0" encoding="utf-8" ?>
<propfind xmnls="DAV:" >
<prop>
<creationdate/>
</prop>
</propfind>
I expect p_namespaceName to be DAV: for prop, creationdate and
propfind, because I have declared the default namespace xmnls=DAV:.
However, my system is giving me an empty string for the namespace. So I can
t tell whether a default namespace was correctly used, or the element is a
part of the null namespace (which would be illegal).
Is this a known problem, or is there something I should be doing
differently?
Re: Newbie. Default Namespace dosen't work? WebDav.
Posted by Hilary Bannister <hi...@cwcom.net>.
Namespaces are defined with the string "xmlns" and not "xmnls". xmnls will be treated as an attribute.
----- Original Message -----
From: John Hall
To: xerces-j-user@xml.apache.org
Sent: 19 March 2001 22:55
Subject: Newbie. Default Namespace dosen't work? WebDav.
My company is using Xerces 1.2.3 (J) for its XML parser. We are implementing WebDav.
The parser calls my function when a new element is encountered:
'startElement( String p_namespaceName, String p_localName, String raw, Attributes p_attrs)
When I use the following XML:
<?xml version="1.0" encoding="utf-8" ?>
<propfind xmnls="DAV:" >
<prop>
<creationdate/>
</prop>
</propfind>
I expect "p_namespaceName" to be "DAV:" for "prop", "creationdate" and "propfind", because I have declared the default namespace "xmnls="DAV:". However, my system is giving me an empty string for the namespace. So I can't tell whether a default namespace was correctly used, or the element is a part of the null namespace (which would be illegal).
Is this a known problem, or is there something I should be doing differently?