X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=web%2Fxml-classes;h=537aca2aa98e4fd8d4d178176bec691b71043b83;hb=50beb484c091b7eb9fdd4cba436757c12f316b8d;hp=f4b39a3210d8771521eeef393d27aa3f21f2b2c4;hpb=1ac8af115d4c569cfac39980fe4b159b303ba893;p=mono.git diff --git a/web/xml-classes b/web/xml-classes index f4b39a3210d..537aca2aa98 100755 --- a/web/xml-classes +++ b/web/xml-classes @@ -2,15 +2,15 @@ ** Abstract - XML library is used by several field of Mono such as ADO.NET and XML - Digital Signature (xmldsig). Here I write about System.Xml.dll and - related tools. This page won't include any classes which are in other + XML library is used by several areas of Mono such as ADO.NET and XML + Digital Signature (xmldsig). Here I write about System.Xml.dll and + related tools. This page won't include any classes which are in other assemblies such as XmlDataDocument. - Note that current corlib has its own XML parser class named Mono.Xml.MiniParser. + Note that current corlib has its own XML parser class (Mono.Xml.MiniParser). - Basically System.XML.dll feature has finished, or almost finished, so - I write this page mainly for bugs and improvement hints. + Basically System.XML.dll feature is almost finished, so I write this + document mainly for bugs and improvement hints. ** System.Xml namespace @@ -18,24 +18,18 @@ *** Document Object Model (Core) - DOM feature has already implemented. There is still missing feature. - - + DOM implementation has finished and our DOM implementation scores better + than MS.NET as to the NIST DOM test results (it is ported by Mainsoft + hackers and in our unit tests). *** Xml Writer Here XmlWriter almost equals to XmlTextWriter. If you want to see - another implementation, check XmlNodeWriter.cs used in monodoc. + another implementation, check XmlNodeWriter.cs and DTMXPathDocumentWriter.cs + in System.XML sources. - XmlTextWriter is completed. However, it looks nearly twice as slow as - MS.NET (I tried 1.1) + XmlTextWriter is completed, though it looks a bit slower than MS.NET (I + tried 1.1). *** XmlResolver @@ -43,22 +37,23 @@ then it uses XmlUrlResolver. XmlResolver is used to parse external DTD, importing XSL stylesheets and schemas etc. - However, XmlUrlResolver is still buggy (mainly because System.Uri is also - incomplete yet) and this results in several loading error. - XmlSecureResolver, which is introduced in MS .NET Framework 1.1 is basically implemented, but it requires CAS (code access security) feature. We need to fixup this class after ongoing CAS effort works. + You might also be interested in an improved XmlCachingResolver by Ben Maurer. + If even one time download is not acceptable, you can use this one. *** XmlNameTable - XmlNameTable itself is implemented. However, it should be actually used in - several classes. Currently it makes sense if compared names are both in - the table, but if it is obvious that compared names are both in this table, - it should be simply compared using ReferenceEquals() (if these names are - different, the comparison is still inefficient yet). + NameTable itself is implemented. It should be actually used in several + classes. Currently it makes sense if compared names are both in the table, + they should be simply compared using ReferenceEquals(). We have done where + it seems possible e.g. in XmlNamespaceManager (in .NET 2.0 methods; if the + build is not NET_2_0, it will be used internally). + NameTable also needs performance improvement. Optimization hackings are + welcome. *** Xml Stream Reader @@ -68,20 +63,23 @@ XmlInputStream class. This may disappear since XmlStreamReader is enough to handle this problem). - However, there are some problems lies in these classes on reading network - stream (especially on Linux). This should be fixed soon. - + However, there used to be some problems in these classes on reading network + stream (especially on Linux). However, this might be already fixed with + some network stream bugfixes. *** XML Reader XmlTextReader, XmlNodeReader and XmlValidatingReader are almost finished. XmlTextReader and XmlValidatingReader should be faster than now. Currently @@ -100,48 +98,53 @@ as normal XML parser does. For example, Mono allows non-deterministic DTD. Another advantage of this XmlValidatingReader is support for *any* XmlReader. - Microsoft supports only XmlTextReader. - - I added extra support interface named "IHasXmlParserContext", which is - considered in XmlValidatingReader.ResolveEntity(). Microsoft failed to - design XmlReader to support pluggable use of XmlReader (i.e. wrapping use - of other XmlReader) since XmlParserContext is required to support both - entity resolution and namespace manager. (In .NET 1.2, Microsoft also - supported similar to IHasXmlParserContext, named IXmlNamespaceResolver, - but it still does not provide any DTD information.) + Microsoft supports only XmlTextReader (this bug will be fixed in VS 2005, + taking shape of XmlFactory). + + I added extra support interface named "IHasXmlParserContext", which is + considered in XmlValidatingReader.ResolveEntity(). This is now + made as internal interface. Microsoft failed to design XmlReader + so that XmlReader cannot be subtree-pluggable (i.e. wrapping use of other + XmlReader) since XmlParserContext shoud be supplied for DTD information + support (e.g. entity references cannot be expanded) and namespace manager. + (In .NET 2.0, Microsoft also supported similar to IHasXmlParserContext, + named IXmlNamespaceResolver, but it still does not provide DTD information.) We also have RELAX NG validating reader. See mcs/class/Commons.Xml.Relaxng. ** System.Xml.Schema +*** Summary + + Basically it is completed. We can compile complex and simple types, refer to + external schemas, extend or restrict other types, or use substitution groups. + You can test how current schema validation engine is complete (incomplete) + by using standalone test module + (see mcs/class/System.XML/Test/System.Xml.Schema/standalone_tests). + At least in my box, msxsdtest fails only 30 cases with bugfixed catalog - + this score is better than that of Microsoft implementation. + *** Schema Object Model - Basically it is implemented. Some features still needs to fix: + Completed, except for some things to be fixed: - Some bugs are remaining, but as far as I tried W3C XML Schema test suite - with bugfixes (of test suite), only 69 out of 7581 has failed. With my test - suite fix, MS.NET failed 48 cases. - *** Validating Reader XML Schema validation feature is (currently) implemented on Mono.Xml.Schema.XsdValidatingReader, which is internally used in - XmlValidatingReader. - + XmlValidatingReader. + Basically this is implemented and actually its feature is almost complete, but I have only did validation feature testing. So we have to write more tests on properties, methods, and events (validation errors). @@ -152,56 +155,67 @@ Lluis rules ;-) Well, in fact XmlSerializer is almost finished and is on bugfix phase. - However, more tests are required especially schema import and export - feature. Please try xsd.exe to create classes from schema, or schema - from class. And if any problems were found, please file it to bugzilla. + However, we appliciate more tests. Please try + + -** System.Xml.XPath and System.Xml.Xsl + And if any problems were found, please file it to bugzilla. - There are two implementations for XSLT. One (and historical) implementation - is based on libxslt. Now we uses fully implemented managed XSLT. + Lluis also built interesting standalone test system placed under + mcs/class/System.Web.Services/Test/standalone. - Putting aside bug fixes, we have to support: + You might also interested in genxs, which enables you to create custom + XML serializer. This is not included in Microsoft.NET. + See here + and manpages for details. Code files are in mcs/tools/genxs. - + +** System.Xml.XPath and System.Xml.Xsl + + There are two XSLT implementations. One and historical implementation is + based on libxslt (aka Unmanaged XSLT). Now we uses fully implemented and + managed XSLT by default. To use Unmanaged XSLT, set MONO_UNMANAGED_XSLT + environment value (any value is acceptable). + + As for Managed XSLT, we support msxsl:script. It would be nice if we can support EXSLT. - Microsoft has already done it, but it - is not good code since it depends on internal concrete derivatives of - XPathNodeIterator classes. In general, .NET's "extension objects" is not - usable to return node-sets, so if we support EXSLT, it has to be done - internally inside our System.XML.dll. Volunteers are welcome. + Microsoft has tried to do some of them, + but it is not good code since it depends on internal concrete derivatives of + XPathNodeIterator classes. + + In general, .NET's "extension objects" (including msxsl:script) is not + useful to return node-sets (MS XSLT implementation rejects just overriden + XPathNodeIterator, but accepts only their hidden classes. And are the same + in Mono though classes are different), so if we support EXSLT, it has to + be done inside our System.XML.dll. Volunteers are welcome. - Our managed XSLT implementation is still inefficient. XslTransform.Load() - and .Transform() looks three times slower (However it depends on - XmlTextReader which is also slow, so we are starting optimization from - that class, not XSLT itself). These number are only for specific cases, - and there might be more critical point on XSLT engine (mainly - XPathNodeIterator). + Our managed XSLT implementation is slower than MS XSLT for some kind of + stylesheets, and faster for some. ** System.Xml and ADO.NET v2.0 - Microsoft introduced the first beta version of .NET Framework 1.2 runtime - and sdk (and Visual Studio Whidbey). They are now available on MSDN + Microsoft released the second beta version of .NET Framework 2.0 with + Visual Studio 2005 alpha version. They are only available on MSDN _subscriber_ download (i.e. it is not publicly downloadable yet). It contains several new classes. There are two assemblies related to System.Xml v2.0; System.Xml.dll and System.Data.SqlXml.dll (here I treat sqlxml.dll as part of System.Xml v2.0, - but it is also one of the ADO.NET 2.0 feature). There are several + but note that it is also one of the ADO.NET 2.0 feature). There are several namespaces such as MS.Internal.Xml and System.Xml. Note that .NET Framework - is pre-release version and MS.Internal.Xml namespace apparently shows that - it is not in stable status as yet. + is pre-release version so that they are subject to change. System.Xml 2.0 contains several features such as: