[XML-SIG] [ pyxml-Bugs-421553 ] stylesheet node reader requires '' NSURI

noreply@sourceforge.net noreply@sourceforge.net
Fri, 04 May 2001 18:06:10 -0700


Bugs item #421553, was updated on 2001-05-04 18:06
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=421553&group_id=6473

Category: 4Suite
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Karl Anderson (karlanderson)
Assigned to: Nobody/Anonymous (nobody)
Summary: stylesheet node reader requires '' NSURI

Initial Comment:

I'm unable to use ParsedXML's DOM as a stylesheet node,
and I think
it's because of a bug in StylesheetReader.py.

The problem is at StylesheetReader.py line 186:

        if not sheet.getAttributeNS('', 'version'):
            raise
XsltException(Error.STYLESHEET_MISSING_VERSION)

...where the NamespaceURI given to getAttributeNS is
''.  This is
supposed to find the namespace-free version attribute
of the
stylesheet documentElement, such as
"""
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
""".

ParsedXML's DOM builder gives this attribute a
NamespaceURI of None
when we parse.

I don't think that you can use the DOM methods to
create a node with a
NamespaceURI of "", since the NamespaceURI is supposed
to be a URI
reference.  Is the empty string a valid URI reference? 
Well, maybe -
the DOM level 2 rec says:
"""
Note that because the DOM does no lexical checking, the
empty string
will be treated as a real namespace URI in DOM Level 2
methods.
Applications must use the value null as the
namespaceURI parameter for
methods if they wish to have no namespace.
"""
But anyway, this indicates that when using DOM creation
methods, a
None should be used as the NamespaceURI for
namespaceless nodes such
as "version", and I think that the stylesheet reader
should accept
that.


----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=106473&aid=421553&group_id=6473