Hi Markus,

The "xml" prefix is always bound to the
"http://www.w3.org/XML/1998/namespace"; namespace. You do not need to
declare it and can never change its binding. If you do not see this
namespace when you're debugging it most likely means that you are using a
SAX parser without namespace support. If you're using JAXP you need to set
namespace awareness to true. It's default (to the surprise of many) is
false. If that's not relevant perhaps you have code which is explicitly
setting the "http://xml.org/sax/features/namespaces"; feature to false. If
you do, you should remove it.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"EXTERNAL Kopf Markus (Itemis; DGS-EC/ESM5)"
<[EMAIL PROTECTED]> wrote on 11/18/2008 03:47:00 AM:

> Hi,
> I test it again but it's the same behaviuor. One question for me is
> in the AbstractSaxParser.startElement(param...) there is first the
> "Qname" and the "XMLAttributes" as parameters. Once I reached this
> point in debug mode and look into the attributes of the qualified
> name "xml:space" the prefix and the uri are null.
> Inside the method is the following code part:
> if (!fNamespacePrefixes) {
>                         for (int i = len - 1; i >= 0; --i) {
>                             attributes.getName(i, fQName);
>                             if ((fQName.prefix ==
XMLSymbols.PREFIX_XMLNS) ||
>                                (fQName.rawname ==
XMLSymbols.PREFIX_XMLNS)) {
>                                 // remove namespace declaration
attributes
>                                 attributes.removeAttributeAt(i);
>                             }
>                         }
>                     }
>                     else if (!fXMLNSURIs) {
>                         for (int i = len - 1; i >= 0; --i) {
>                             attributes.getName(i, fQName);
>                             if ((fQName.prefix ==
XMLSymbols.PREFIX_XMLNS) ||
>                                (fQName.rawname ==
XMLSymbols.PREFIX_XMLNS)) {
>                                 // localpart should be empty string
> as per SAX documentation:
>                                 // http://www.saxproject.org/?
> selected=namespaces
>                                 fQName.prefix = "";
>                                 fQName.uri = "";
>                                 fQName.localpart = "";
>                                 attributes.setName(i, fQName);
>                             }
>                         }
>                     }
>
> In this part only "xmlns" prefixes are processed but where is the
> part for "xml"?
> Is the "xml" namespace part standard and must not be processed like
> the other namespaces?
> A further question is, is it necessary to set in the namespace of
> the digester "http://www.w3.org/XML/1998/namespace";?
> Thanks for the fast replay of my last question!!!!!
> Mit freundlichen Grüßen / Best regards
> Markus Kopf
> Robert Bosch GmbH
> Diesel Gasoline Systems
> Postfach 30 02 40
> 70442 Stuttgart
> GERMANY
> www.bosch.com
> Tel. +49 711 81138551
> Mobil +49 151 10860465
> [EMAIL PROTECTED]
> Sitz: Stuttgart, Registergericht: Amtsgericht Stuttgart HRB 14000
> Aufsichtsratsvorsitzender: Hermann Scholl; Geschäftsführung: Franz
> Fehrenbach, Siegfried Dais;
> Bernd Bohr, Rudolf Colm, Gerhard Kümmel, Wolfgang Malchow, Peter Marks;
> Volkmar Denner, Uwe Raschke, Peter Tyroller

Reply via email to