Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Namespace and attributes.

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Hugues Cassé <casse AT netcourrier.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Namespace and attributes.
  • Date: Wed, 19 Feb 2003 23:17:20 +0100

I guess if I have missed something. Else the following holds.

It is written in the documentation of the method setNamespace() of the
Attribute class:

NamespaceException - if

(1) * The prefix is xmlns
(2) * The prefix is xml and the namespace URI is not
http://www.w3.org/XML/1998/namespace
(3) * The prefix is null or the empty string.
(4) * The URI is null or the empty string.
(5) * The prefix conflicts with an existing declaration on the
attribute's parent element.

Yet, according to the namespace specification
(http://www.w3.org/TR/REC-xml-names/), the namespace of an attribute without
prefix is the namespace of its element. If the element has a prefix, the
attribute namespace is the one matching the prefix else it is the current
default namespace.
This fact is demonstrated, especially by the example about attributes at
the end of the document (A.3 paragraph).
So, we have the situation where an attribute may have a namespace but no
prefix, so that the rule (3) does not stand.

Thank you for clarifying this issue.
H. Cassé.
>From elharo AT metalab.unc.edu Wed Feb 19 22:25:12 2003
Return-Path: <elharo AT metalab.unc.edu>
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213])
by happyhouse.metalab.unc.edu (Postfix) with ESMTP id 4945C20013
for <xom-interest AT lists.ibiblio.org>;
Wed, 19 Feb 2003 22:25:12 -0500 (EST)
Received: (qmail 13536 invoked from network); 20 Feb 2003 03:26:38 -0000
Received: from unknown (HELO [192.168.254.4]) ([216.254.85.72])
(envelope-sender <elharo AT metalab.unc.edu>)
by mail13.speakeasy.net (qmail-ldap-1.03) with SMTP
for <casse AT netcourrier.com>; 20 Feb 2003 03:26:38 -0000
Mime-Version: 1.0
X-Sender: elharo AT mail.ibiblio.org
Message-Id: <p04330100ba79f68fd6e6@[192.168.254.4]>
In-Reply-To: <20030219231720.4853a160.casse AT netcourrier.com>
References: <20030219231720.4853a160.casse AT netcourrier.com>
Date: Wed, 19 Feb 2003 22:07:17 -0500
To: Hugues =?iso-8859-1?Q?Cass=E9?= <casse AT netcourrier.com>,
xom-interest AT lists.ibiblio.org
From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
Subject: Re: [XOM-interest] Namespace and attributes.
Content-Type: text/plain; charset="iso-8859-1" ; format="flowed"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: <xom-interest.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Feb 2003 03:25:12 -0000

At 11:17 PM +0100 2/19/03, Hugues Cass=E9 wrote:
> I guess if I have missed something. Else the following holds.
>
> It is written in the documentation of the method setNamespace() of
>the Attribute class:
>
> NamespaceException - if
>
>(1) * The prefix is xmlns
>(2) * The prefix is xml and the namespace URI is not
>http://www.w3.org/XML/1998/namespace
>(3) * The prefix is null or the empty string.
>(4) * The URI is null or the empty string.
>(5) * The prefix conflicts with an existing declaration on
>the attribute's parent element.
>
> Yet, according to the namespace specification
>(http://www.w3.org/TR/REC-xml-names/), the namespace of an attribute
>without prefix is the namespace of its element.

No, That's not true. That is not what the namespace specification
says. Unprefixed attributes are never in any namespace.

Yes, it's a strange rule. No, I didn't make this rule up. XOM is
simply being as weird as namespaces are.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| Processing XML with Java (Addison-Wesley, 2002) |
| http://www.cafeconleche.org/books/xmljava |
| http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+
>From seb AT inovo.be Mon Feb 24 11:29:56 2003
Return-Path: <seb AT inovo.be>
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from mailserver01.cybernet.be (mailserver01.cybernet.be
[213.177.64.33])
by happyhouse.metalab.unc.edu (Postfix) with ESMTP id 1680920021
for <xom-interest AT lists.ibiblio.org>;
Mon, 24 Feb 2003 11:29:56 -0500 (EST)
Received: from PC3 ([213.177.68.243])
microdrive) with ESMTP id GPA37015
for <xom-interest AT lists.ibiblio.org>; Mon, 24 Feb 2003 17:31:12 +0100
From: "Sebastien Brissaud" <seb AT inovo.be>
To: <xom-interest AT lists.ibiblio.org>
Date: Mon, 24 Feb 2003 17:34:48 +0100
Organization: inOvo
Message-ID: <005d01c2dc22$a77e5b70$0b01a8c0@PC3>
MIME-Version: 1.0
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.2616
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300
Subject: [XOM-interest] "&#x" vs. "&0x"
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.1
Precedence: list
List-Id: <xom-interest.lists.ibiblio.org>
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Mon, 24 Feb 2003 16:29:56 -0000

Hi all,

In TextWriter.java, the method writeAttributeValue(char) escape =
characters with the "&0x" prefix instead of "&#x" in the =
writePCDATA(char) method.
After reading the XML Recommendation =
(http://www.w3.org/TR/REC-xml#wf-Legalchar), I think than character in =
attributes values should be escaped with the "&#x" prefix.
Is it something I have missed who justify the use of the "&0x" prefix?

Thanks in advance
Sebastien



  • [XOM-interest] Namespace and attributes., Hugues Cassé, 02/19/2003

Archive powered by MHonArc 2.6.24.

Top of Page