Might be a bug though there are certainly more direct ways of determining
namespace awareness. Specifically, checking the state of the SAX namespace
feature [1].

Thanks.

[1] http://xerces.apache.org/xerces2-j/features.html#namespaces

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Tuomas Kiviaho <tuomas.kivi...@iki.fi> wrote on 09/10/2009 11:43:28 PM:

>
> When XMLDocumentFragmentScannerImpl scans elements it doesn't pass on any
> localName or namespaceURI values, but for attributes it contains
following
> lines...
>
>     protected void scanAttribute(XMLAttributes attributes) throws
> IOException, XNIException {
>         ...
>         if (fNamespaces) {
>             fEntityScanner.scanQName(fAttributeQName);
>         }
>         else {
>             String name = fEntityScanner.scanName();
>             fAttributeQName.setValues(null, name, name, null);
>         }
>
> The latter one kicks in and name is applied to both qName and localName.
> According to <http://www.saxproject.org/namespaces.html> in my opinion
the
> localName should be empty.
>
> I've trusted so far localName being empty to imply that namespace
awareness
> is turned off. Luckily I can work around this problem in SAX relying on
> element localName being empty instead.
>
> --
> Tuomas
> --
> View this message in context: http://www.nabble.com/Why-does-
> attribute-localName-exist-when-namespace-awareness-is-turned-off--
> tp25394586p25394586.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to