xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elliotte Rusty Harold <elh...@metalab.unc.edu>
Subject Re: Problem with attribute namespaces
Date Sat, 13 Jul 2002 09:08:33 GMT
At 3:46 PM -0400 7/12/02, Brenda Bell wrote:
I've used several different SAXParsers to parse the following document:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:soap="<http://schemas.xmlsoap.org/soap/envelope/>http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>http://www.w3.org/2001/XMLSchema-instance"

xmlns:xsd="<http://www.w3.org/2001/XMLSchema>http://www.w3.org/2001/XMLSchema">

   <soap:Body>
     <businessList generic="1.0" operator="Microsoft Corporation" 
truncated="false" xmlns="urn:uddi-org:api">
       <businessInfos>
         <businessInfo businessKey="ba744ed0-3aaf-11d5-80dc-002035229c64">



Where I'm having a problem is in my handler's startElement 
implementation.  Seems that attributes(idx).getURI() always returns 
an empty string.  For an attribute like businessKey, I would have 
expected the default URI "urn:uddi-org:api".

Is this a bug in the parser?  Or am I doing something wrong?

The latter. Default namespaces never apply to attributes. The parser 
is correct. An unprefixed attribute is *never* in a namespace, not 
the default namespace, not the namespace of its parent element, no 
namespace ever.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message