|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Partyin' like it's 1999
Joshua Allen wrote: > No way for a parser to return a single attribute value without parsing > all the way to the end of the start tag. For example, if you have: > > <foo x:id="a" y:id="a" ...insert a bajillion attributes here... > xmlns:x="foo" xmlns:y="foo"> > > You have malformed XML right at the beginning, but the parser doesn't > know to throw (and cannot even accurately report the first or second > attribute) until it has parsed a bajillion other attributes first. Why > is it allowed for the xmlns to come *after* the first use of the prefix > anyway (order of attributes doesn't matter, so to hell with perf) This doesn't arise in practice. It's a corner case. Tool vendors need to handle it, but honestly the API complexity of allowing streaming attributes argues against this approach, even if it were possible to implement. > What if the xmlns declaration is on an ancestor node, and you call > .InnerXml on DOM from a child node. Should the .InnerXml represent the > text content of the subtree, in which case it would lose the namespace > decl if written to text, or should it insert an extra xmlns decl? You > get into all sorts of crazy situations; dumping entire set of NS decls > in scope on XSLT output, generating bogus prefixes on output. InnerXml is an ugly, non-standard Microsoft hack. Eliminate it. Problem solved. Don't blame XML for your own mistakes. -- Elliotte Rusty Harold elharo@m... XML in a Nutshell 3rd Edition Just Published! http://www.cafeconleche.org/books/xian3/ http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








