[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[DotGNU]Xml Alien Invasion - A standards war
From: |
minddog |
Subject: |
[DotGNU]Xml Alien Invasion - A standards war |
Date: |
Tue, 14 Jan 2003 13:26:54 -0700 |
User-agent: |
KMail/1.4.3 |
Gopal, Simon, I and others were discussing compatibility issues between mono,
rotor, pnet, and .Net 's XmlTextReader::Read() method...
Read() in our System.Xml will basically look through a tag ie:
<element attribute="textvalue">textvalue</element>
respectively scans a NodeType per Read() instruction
<XmlNodeType.Element
XmlNodeType.Attribute="XmlNodeType.Text">XmlNodeType.Text</XmlNodeType.EndElement>
a testcase ran with
using System;
using System.IO;
using System.Xml;
public class XmlTest
{
public static void Main()
{
String data="<tag attr=\"foo\">data</tag>";
StringReader stream=new StringReader(data);
XmlTextReader r=new XmlTextReader(stream);
r.Read();
Console.WriteLine(stream.ReadLine());
}
}
address@hidden tests]$ ilrun a.out.exe
attr="foo">data</tag>
address@hidden tests]$ mono a.out.exe
data</tag>
address@hidden tests]
And .NET outputs Nothing ....
Gopal and I have come up with a solution that will turn Read() into ReadNode()
and then creating a wrapper called Read() that will read up to the '>' per
tag.
This is the only necessary way to enable the XmlTextReader::MoveTo* methods
to properly work. My opinion is that the only thing worth making these
changes for is the Qt# generator, which is a handbuilt XmlTextReader. I was
told it was built with mono's reader in mind, because they have no
implemented anything that builds a DOM structure at that point in time. In
my opinion all these MoveTo* methods are redundant in the ecma standard, but
it comes down to being ecma compliant at the end of the day. It will only
cost us an internal class and another wrapper method inside XmlTextReader.
What are your thoughts, should we lead the standard and fix redundancy in the
ECMA spec? I could help out with the generator and make it work with
XmlDocument since its the same across all implementations AFAIK. That could
save us from hurting speed we get from Reader at present. I've included a
half working patch that Gopal has sent to me earlier that is up to the latest
cvs.
Now it's time for a coffee break.
regards,
--
--minddog( Adam Ballai )
"I try to take it one day at a time, but several of them attack me at once."
-mistyflip
xmltextreaderpatch.patch
Description: Text Data
- [DotGNU]Xml Alien Invasion - A standards war,
minddog <=