You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Carsten Ziegeler <cz...@sundn.de> on 2001/01/09 10:40:43 UTC

Q: Namespace attributes

Hello,

I have a question concerning Xerxes-J 1.2.3 and the http://xml.org/sax/features/namespace-prefixes feature.

After setting this to true, Xerces includes the original namespace attributes in the SAX events.

Regarding the following element

<sunshine:insert xmlns:sunshine="http://sunshine.sundn.de/sunshine/1.0">

is it correct that the corresponding attribute has the following values:
uri=
name=sunshine
raw=xmlns:sunshine
value=http://sunshine.sundn.de/sunshine/1.0

How can I detect that this is a namespace attribute? Simply by comparing the prefix of raw with "xmlns:" ?


Thanks,

Carsten


Re: Q: Namespace attributes

Posted by Andy Clark <an...@apache.org>.
Carsten Ziegeler wrote:
> is it correct that the corresponding attribute has the following 
> values:
> uri=
> name=sunshine
> raw=xmlns:sunshine
> value=http://sunshine.sundn.de/sunshine/1.0

Yes.

> How can I detect that this is a namespace attribute? Simply by 
> comparing the prefix of raw with "xmlns:" ?

Yes. The namespace spec states that the "xmlns" prefix is not
bound to a URI, so you have to see if the rawname starts with
"xmlns:" or is equal to "xmlns". I think the latter case is
why the prefix is not bound -- because there is no prefix to
bind in that case.

-- 
Andy Clark * IBM, TRL - Japan * andyc@apache.org