SAX2: summary of Namespace-support arguments

Rick Jelliffe ricko at allette.com.au
Tue Dec 21 06:17:12 GMT 1999


From: James Clark <jjc at jclark.com>

 >Rick Jelliffe wrote:
>>
>>  From: James Clark <jjc at jclark.com>
>>
>>  >I do indeed want that, and in the past I've argued against
*requiring*
>> >processors to provide information about the prefix used. I've become
a
>> >lot less negative about this prefix information recently and I think
>> >it's better for an API to provide it
>>
>> Isn't it a requirement for XSL?
>
>No.  XSL requires only information about what namespace declarations
are
>in scope, not what prefix was actually used.

Sorry for being thick:  are you using "namespace declaration" here to
mean
that each use of a namespace should point to its declaration rather than
just
to the simple namespace URI?   I strongly agree.

It seems like we need to get away from the idea that two namespace
objects
are equal if their URI strings are equal.  Either we need to know the
address of the definition of the object (in languages that support this)
or
the object also needs to have some definition-occurrence indicator:
this could be an identifier or a position on a stack. (If it is an
indentifier
then  I think the prefix would do fine.)

For other people, the issue comes up in XSL, where one can have
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:axsl="http://www.w3.org/1999/XSL/TransformAlias"
>
    ...
    <xsl:template match="/">
        <axsl:value-of select="xxx"/>
    </xsl:template>
</xsl:stylesheet>

In this document, the axsl: element will not be interpreted
as an XSLT function by an XSL processor: it will be output
unchanged as
    <axsl:value-of select="xxx"/>

So an API that resolves namespaces cannot merely replace
the prefix with the URI and the suffix:

<(http://www.w3.org/1999/XSL/Transform)stylesheet
  version="1.0"
>
    ...
    <(http://www.w3.org/1999/XSL/Transform)template match="/">
        <(http://www.w3.org/1999/XSL/Transform)value-of select="xxx"/>
    </(http://www.w3.org/1999/XSL/Transform)template>
</(http://www.w3.org/1999/XSL/Transform)stylesheet>

because that loses the scope.

B.T.W., I cannot see how this can be reconciled with the current
information set Last Call draft (which seems to drop the prefix).
I think it means that any API that simply drops the prefix (or
scoping information in liu of the prefix) is incorrect.


Rick Jelliffe


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)





More information about the Xml-dev mailing list