[Home] [By Thread] [By Date] [Recent Entries]

  • To: "'John Cowan'" <cowan@c...>
  • Subject: RE: qName/localName confusion
  • From: "Michael Kay" <michael.h.kay@n...>
  • Date: Thu, 18 Mar 2004 10:27:55 -0000
  • Cc: <xml-dev@l...>
  • In-reply-to: <20040318035004.GL12076@c...>
  • Thread-index: AcQMnCBTJ+IlRPDHRoGsgWxCOxpkhQANw/ag

# 
# > Firstly, turning on the feature might fail. I don't know how many 
# > parsers don't support the feature; I would have to decide 
# whether to 
# > support such parsers or not; I would have to test the code 
# that handles such a failure.
# 
# This is a required feature.  Of course, that doesn't mean all 
# parsers actually do it.

We're talking about the namespace-prefixes feature: 

From XMLReader#setFeature:

All XMLReaders are required to support setting
http://xml.org/sax/features/namespaces to true and
http://xml.org/sax/features/namespace-prefixes to false.

and from ContentHandler#startElement:

The attribute list will contain attributes used for Namespace declarations
(xmlns* attributes) only if the
http://xml.org/sax/features/namespace-prefixes  property is true (it is
false by default, and support for a true value is optional).


# 
# > Secondly, the parser would then give me namespace 
# declarations in the 
# > attributes list that I'm not interested in. It would 
# presumably have 
# > to do extra work to put them there, and I would have to do 
# extra work 
# > to take them out again.
# 
# I don't follow this.  Setting namespace-prefixes means that 
# you get the prefixes associated with each element and 
# attribute that has one.
# It doesn't involve inserting new attributes.

See above.

Michael Kay


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member