[
Lists Home |
Date Index |
Thread Index
]
- From: terje@in-progress.com (Terje Norderhaug)
- To: xml-dev@xml.org
- Date: Sat, 5 Feb 2000 10:28:59 -0800
At 4:46 AM 2/5/00, Stefan Haustein wrote:
>> There has also been a discussion about how to encode names with an
>> associated namespace, typically by merging the two into a string.
>> Suggestions ranged from placing brackets around the namespace URI to
>> separating the URI from the actual name with a space.
>
>Do you know if an official recommendation for storing a
>namespace-name pair in a single string exists? I switched
>to combined names in my application because they are much
>simpler to handle than pairs of separate string objects.
My proposal is NOT based on storing a combined namespace-name pair in a
single string. Instead, the string only consists of the local name.
Given that each local name is internalized in its namespace, it becomes
possible to find the namespace of a local name without encoding the
namespace as part of the string.
>> The current SAX2 beta uses multiple strings to represent a name in its
>> namespace. This has caused several of the methods in the recent beta of
>> SAX2 to have a rather cluttered argument list compared to SAX1.
>>
>> PROPOSAL
>>
>> I suggest that parsers interns each name as a separate string in the
>> namespace it belong to. This should guarantee that two equal names in the
>> same namespace are identical, and that two equal names in different
>> namespaces are unidentical.
>
>Sounds too complicated for broad acceptance, and I must admit that I do
>not
>see the great benefit. From an OOP point of view, it would probably be
>cleaner to have an own object or interface combining namespace, name and
>prefix,
>providing corresponding compare methods, but this is a discussion we
>already
>had some time ago....
As you point out, previous discussion was in favor of representing names as
strings rather than compound objects. I have shown that you can use strings
to represent names without encoding the namespace as part of the string,
yet be able to identify the namespace of the name.
This means that we can have a string representation of names as with SAX1
and still have an interface to names as if they were compund objects.
-- Terje <terje@in-progress.com> | Media Design in*Progress
Software for Mac Web Professionals at <http://www.in-progress.com>
Take advantage of XML with Emile, the first XML editor for Mac!
|