[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] XML processor behavior with unused NS declarations
- From: "Michael Kay" <mike@saxonica.com>
- To: "'Evan Lenz'" <evan@evanlenz.net>,"'Jim Tivy'" <jimt@bluestream.com>
- Date: Fri, 24 Jul 2009 10:07:35 +0100
> It sounds like you're referring to a different scenario ("a
> yet unused namespace declaration"). I'm talking about a
> repeat of the exact same URI/prefix binding in a location
> where it's already in scope. For example:
>
> <foo xmlns:ex="http://example.com">
> <bar xmlns:ex="http://example.com">
> <bat xmlns:ex="http://example.com"/>
> </bar>
> </foo>
>
> Have you ever come across a scenario where the second two
> "ex" namespace declarations could not be safely removed?
> Canonicalization removes the latter two, and it *should*
> always be safe for a generic
> (namespace-aware) XML processor to remove them.
I agree it should be safe, and I've never seen a situation where it isn't.
The XDM model used by XSLT and XPath doesn't allow the presence of these
redundant declarations to be detected or created. However the infoset,
regrettably, exposes them (via the [namespace attributes] property of the
element).
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]