April 22, 2004

the dark side of the moon

Just a note, I found that in the recent article about mono on osnews, there was a mention about XmlDocument.GetElementById(). There has been description about it (why it is incomplete). GetElementById() is one of the troublesome part of the DOM specification (and I don't like it) and I don't feel I had better dig into it. If you still think that method is "the most important" as the author says, you don't have to hesitate to use it... I think it is as stable as Microsoft.NET.

I have been frustrated that there is an proposal to change copyright law from Japanese Agency for Cultural Affairs in Japan. In the draft, they required exclusive import entitlement for CDs. They had been explained that "the law does not means imported CDs are prohibited in Japan."
But one Japanese attorney pointed out that with that law any foreign lebels can "prohibit" specific import of CDs, and thus Amazon might be regarded as "illegal" in Japan (since there is "no-discount resale system" in Japan, many people prefer Amazon to buy CDs. That system have long been criticized by most of people except for publishing companies).
After this pointout, the agency changed their explaination that "The lebels promised us not to prohibit import." However, recently it is said that there are many copy of "excerpted comment from RIAA" (not sure if it is true) on the net, saying that:

We thus strongly caution against the adoption of discriminatory legislation, and call upon the Government to provide rights to control importation with regard to all repertoire.

The law is likely to pass the Congress, while I haven't seen any people including academic persons who agree to that draft, except for the agency and concerned associations. And sadly to say, the iron-triangle is so strong here.

I also found a potentially sad thing that MS ADO.NET uses XmlDocument in DataSet.ReadXml(). I wonder if the way is required to implement that method... it is a big waste of memory to load the entire document to memory.

Posted by atsushi at April 22, 2004 06:20 AM
Comments

I almost never use the GetElementById() method when working with the XmlDocument. The only time I use it, is when scripting the HTML DOM, which MONO shouldn't care much about. I don't understand what the problem with it is, though.

It sounds terrible that ReadXml() uses XmlDocument. That can't be necessary at all, could it? Using the XmlReader is much faster and memory economic, and I don't understand why XmlDocument should be needed. Seems like a bug or glitch to me.

Posted by: Asbjørn Ulsberg on April 22, 2004 06:05 PM

As for DataSet, I am not sure, but there _might_ be problem with streaming reader (though such design should be fixed at design time), e.g. on changing their columns into table. Unlike us, MS guys had to design and implement it, so XmlReader is not suitable for such experimental development. Mono's DataSet is implemented similarly using XmlDocument and I'm on trying to rewrite it (well, there are many problem stack in front of it ;-).

GetElementById() is used to implement XPath(Navigator). I use them mostly only when document is read only. Well, I wrote some buggy cases:

http://primates.ximian.com/~atsushi/getelementbyid-is-cool.cs

Posted by: Atsushi Eno on April 23, 2004 04:40 AM

Do you think it's possible to implement ReadXml() without XmlDocument in Mono, without breaking compatibility with .NET? I sure hope so. If it is, Mono's ReadXml() will probably be a lot faster and less memory consuming than .NET's, which is kind of fun.

Good luck with GetElementById(). Hope you get it to work, eventually. :-)

Posted by: Asbjørn Ulsberg on April 26, 2004 11:21 PM
Post a comment