Author: atsushi
Date: 2006-01-14 22:24:19 -0500 (Sat, 14 Jan 2006)
New Revision: 55590
Removed:
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTypeTests.cs
tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/datatypesTest.xsd
Modified:
tags/mono-1-1-13/mcs/class/System.XML/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlAtomicValue.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlWriter.cs
tags/mono-1-1-13/mcs/class/System.XML/System.Xml_test.dll.sources
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaSetTests.cs
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/ChangeLog
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/ChangeLog
Log:
revert r55476, incorrectly made changes to the tag, not the branch
Modified: tags/mono-1-1-13/mcs/class/System.XML/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/ChangeLog 2006-01-15 01:21:30 UTC
(rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/ChangeLog 2006-01-15 03:24:19 UTC
(rev 55590)
@@ -1,12 +1,3 @@
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * System.Xml_test.dll.sources : added XmlSchemaTypeTests.cs.
-
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * System.Xml_test.dll.sources : XmlSchemaDatatypeTests.cs was missing.
- collected sys.xml.schema lines.
-
2005-12-28 Gert Driesen <[EMAIL PROTECTED]>
* System.Xml_test.dll.sources: Added XmlSchemaExporterTests.cs.
Modified: tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/ChangeLog
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,9 +1,3 @@
-2006-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlSchemaValidatingReader.cs : removed unused constructors.
- Now it implements IXmlSchemaInfo. Use XmlSchemaType instead of
- Object to represent schema types.
-
2006-01-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XsdValidatingReader.cs :
Modified:
tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/Mono.Xml.Schema/XmlSchemaValidatingReader.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -76,8 +76,7 @@
namespace Mono.Xml.Schema
{
- internal class XmlSchemaValidatingReader : XmlReader, IXmlLineInfo,
- IXmlSchemaInfo
+ internal class XmlSchemaValidatingReader : XmlReader, IXmlLineInfo
{
static readonly XsAttr [] emptyAttributeArray =
new XsAttr [0];
@@ -92,6 +91,7 @@
IXmlLineInfo readerLineInfo;
ValidationType validationType;
IXmlNamespaceResolver nsResolver;
+// IHasXmlSchemaInfo sourceReaderSchemaInfo;
int startDepth;
StringBuilder tmpBuilder = new StringBuilder ();
@@ -100,14 +100,48 @@
int currentDefaultAttribute = -1;
ArrayList defaultAttributesCache = new ArrayList ();
bool defaultAttributeConsumed;
- XmlSchemaType currentAttrType;
+ object currentAttrType;
// Extra for XmlSchemaValidtingReader
// (not in XsdValidatingReader)
XsElement element; // ... xsinfo.Element?
+ object xsiType; // ... xsinfo.SchemaType?
#endregion
+ public XmlSchemaValidatingReader (XmlReader reader,
XmlSchemaSet schemas)
+ {
+ nsResolver = reader as IXmlNamespaceResolver;
+ if (nsResolver == null)
+ throw new ArgumentException ("Argument
XmlReader must implement IXmlNamespaceResolver.");
+ options = ValidationFlags.ReportValidationWarnings
+ | ValidationFlags.ProcessSchemaLocation
+ | ValidationFlags.ProcessInlineSchema;
+
+ this.reader = reader;
+ if (schemas == null)
+ schemas = new XmlSchemaSet ();
+ v = new XmlSchemaValidator (
+ reader.NameTable,
+ schemas,
+ nsResolver,
+ options);
+
+ readerLineInfo = reader as IXmlLineInfo;
+ startDepth = reader.Depth;
+ getter = delegate () { return Value; };
+ xsinfo = new XmlSchemaInfo (); // transition cache
+ v.LineInfoProvider = this;
+ v.ValidationEventSender = reader;
+#if !NON_MONO
+ v.XmlResolver = schemas.XmlResolver;
+#else
+ v.XmlResolver = new XmlUrlResolver ();
+#endif
+ v.SourceUri = new Uri (null, reader.BaseURI); // FIXME:
it is in fact not in MS.NET.
+ v.Initialize ();
+ }
+
public XmlSchemaValidatingReader (XmlReader reader,
XmlReaderSettings settings)
{
@@ -130,7 +164,6 @@
readerLineInfo = reader as IXmlLineInfo;
startDepth = reader.Depth;
getter = delegate () { return Value; };
- xsinfo = new XmlSchemaInfo (); // transition cache
v.LineInfoProvider = this;
v.ValidationEventSender = reader;
#if !NON_MONO
@@ -144,11 +177,48 @@
v.Initialize ();
}
+ public XmlSchemaValidatingReader (
+ XPathNavigator navigator,
+ XmlSchemaSet schemas,
+ ValidationEventHandler handler)
+ {
+ this.reader = navigator.ReadSubtree ();
+ startDepth = reader.Depth;
+ IXmlSchemaInfo info = navigator.SchemaInfo;
+ SchemaType schemaType = info != null ?
+ info.SchemaType : null;
+
+ if (schemas == null && schemaType == null)
+ throw new ArgumentException ("Neither of
XmlSchemaSet is specified, nor XPathNavigator does not provide schema type
information on current node.");
+
+ if (schemas == null)
+ schemas = new XmlSchemaSet (reader.NameTable);
+
+ v = new XmlSchemaValidator (
+ navigator.NameTable,
+ schemas,
+ navigator,
+ ValidationFlags.ProcessIdentityConstraints);
+
+ readerLineInfo = navigator as IXmlLineInfo;
+ getter = delegate () { return Value; };
+ v.LineInfoProvider = this;
+ v.ValidationEventSender = navigator;
+#if !NON_MONO
+ v.XmlResolver = schemas.XmlResolver;
+#else
+ v.XmlResolver = new XmlUrlResolver ();
+#endif
+ v.Initialize (schemaType);
+ }
+
public ValidationEventHandler ValidationEventHandler;
- public XmlSchemaType ElementSchemaType {
+ public object ActualType {
get {
- return element != null ?
element.ElementSchemaType : null;
+ return xsiType != null ?
+ xsiType :
+ element != null ? element.ElementType :
null;
}
}
@@ -172,24 +242,24 @@
get { return readerLineInfo != null ?
readerLineInfo.LinePosition : 0; }
}
- public XmlSchemaType SchemaType {
+ public object SchemaType {
get {
if (ReadState != ReadState.Interactive)
return null;
switch (NodeType) {
case XmlNodeType.Element:
- if (ElementSchemaType != null)
- return ElementSchemaType;
+ if (ActualType != null)
+ return ActualType;
else
return
null;//SourceReaderSchemaType;
case XmlNodeType.Attribute:
if (currentAttrType == null) {
- ComplexType ct =
ElementSchemaType as ComplexType;
+ ComplexType ct = ActualType as
ComplexType;
if (ct != null) {
XsAttr attdef =
ct.AttributeUses [new XmlQualifiedName (LocalName, NamespaceURI)] as XsAttr;
if (attdef != null)
- currentAttrType
= attdef.AttributeSchemaType;
+ currentAttrType
= attdef.AttributeType;
return currentAttrType;
}
// currentAttrType =
SourceReaderSchemaType;
@@ -380,7 +450,7 @@
}
public override IXmlSchemaInfo SchemaInfo {
- get { return this; }
+ get { return xsinfo; }
}
public override string Value {
@@ -785,30 +855,6 @@
}
#endregion
-
- #region IXmlSchemaInfo
-
- public bool IsNil {
- get { return xsinfo.IsNil; }
- }
-
- public XmlSchemaSimpleType MemberType {
- get { return xsinfo.MemberType; }
- }
-
- public XmlSchemaAttribute SchemaAttribute {
- get { return xsinfo.SchemaAttribute; }
- }
-
- public XmlSchemaElement SchemaElement {
- get { return xsinfo.SchemaElement; }
- }
-
- public XmlSchemaValidity Validity {
- get { return xsinfo.Validity; }
- }
-
- #endregion
}
}
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml/ChangeLog 2006-01-15
01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml/ChangeLog 2006-01-15
03:24:19 UTC (rev 55590)
@@ -1,28 +1,3 @@
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlTextWriter.cs : Do not local duplicate of automatically-created
- prefixes (i.e. check local autocreated prefixes other than
- namespaces from ancestors). Fixed bug #77086 and #77087.
-
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlWriter.cs : use XmlChar.IsNmToken() to check argument and throw
- ArgumentException in WriteNmTokenInternal().
-
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlTextWriter.cs : Fixed bug #77094. Only XmlTextWriter checks
- such invalid "xml" prefix which is being mapped to different
- namespace URI than the predefined one.
- Removed comment that does not make sense.
- * XmlNamespaceManager.cs : IsValidDeclaration() could be private.
- Added some comments.
-
-2006-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * DTDObjectModel.cs : dtd2xsd fix; set use="optional" when an
- attribute is #IMPLIED.
-
2006-01-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlWriter.cs : In WriteNode(XPathNavigator, bool), Avoid
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml/DTDObjectModel.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -833,8 +833,6 @@
SetLineInfo (a);
a.Name = Name;
a.DefaultValue = resolvedNormalizedDefaultValue;
- if (OccurenceType != DTDAttributeOccurenceType.Required)
- a.Use = XmlSchemaUse.Optional;
XmlQualifiedName qname = XmlQualifiedName.Empty;
ArrayList enumeration = null;
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlNamespaceManager.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -170,11 +170,9 @@
decls [declPos].Uri = uri;
}
- static string IsValidDeclaration (string prefix, string uri,
bool throwException)
+ internal static string IsValidDeclaration (string prefix,
string uri, bool throwException)
{
string message = null;
- // It is funky, but it does not check whether prefix
- // is equivalent to "xml" in case-insensitive means.
if (prefix == PrefixXml && uri != XmlnsXml)
message = String.Format ("Prefix \"xml\" can
only be bound to the fixed namespace URI \"{0}\". \"{1}\" is invalid.",
XmlnsXml, uri);
else if (message == null && prefix == "xmlns")
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -752,6 +752,8 @@
public override void WriteStartAttribute (string prefix, string
localName, string ns)
{
if (prefix == "xml") {
+ // MS.NET looks to allow other names than
+ // lang and space (e.g. xml:link, xml:hack).
ns = XmlNamespaceManager.XmlnsXml;
if (localName == "lang")
openXmlLang = true;
@@ -797,7 +799,7 @@
string formatPrefix = "";
if (ns != String.Empty && prefix != "xmlns") {
- string existingPrefix = GetExistingPrefix (ns);
+ string existingPrefix =
namespaceManager.LookupPrefix (ns, false);
if (existingPrefix == null || existingPrefix ==
"") {
bool createPrefix = false;
@@ -852,15 +854,6 @@
}
}
- string GetExistingPrefix (string ns)
- {
- if (newAttributeNamespaces.ContainsValue (ns))
- foreach (DictionaryEntry de in
newAttributeNamespaces)
- if (de.Value as string == ns)
- return (string) de.Key;
- return namespaceManager.LookupPrefix (ns, false);
- }
-
private string CheckNewPrefix (bool createPrefix, string
prefix, string ns)
{
do {
@@ -923,14 +916,6 @@
if ((prefix != null && prefix.Length > 0) && ((ns ==
null)))
throw ArgumentError ("Cannot use a prefix with
an empty namespace.");
- // Considering the fact that WriteStartAttribute()
- // automatically changes argument namespaceURI, this
- // is kind of silly implementation. See bug #77094.
- if (Namespaces &&
- ns != XmlNamespaceManager.XmlnsXml &&
- String.Compare (prefix, "xml", true) == 0)
- throw new ArgumentException ("A prefix cannot
be equivalent to \"xml\" in case-insensitive match.");
-
// ignore non-namespaced node's prefix.
if (ns == null || ns == String.Empty)
prefix = String.Empty;
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlWriter.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlWriter.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml/XmlWriter.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -360,19 +360,16 @@
internal virtual void WriteNmTokenInternal (string name)
{
- bool valid = true;
#if NET_2_0
switch (Settings.ConformanceLevel) {
case ConformanceLevel.Document:
case ConformanceLevel.Fragment:
- valid = XmlChar.IsNmToken (name);
- break;
+ XmlConvert.VerifyNMTOKEN (name);
+ break;
}
#else
- valid = XmlChar.IsNmToken (name);
+ XmlConvert.VerifyNMTOKEN (name);
#endif
- if (!valid)
- throw new ArgumentException ("Argument name is
not a valid NMTOKEN.");
WriteString (name);
}
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/ChangeLog
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/ChangeLog
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,18 +1,3 @@
-2006-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlSchemaAttribute.cs, XmlSchemaElement.cs : AttributeSchemaType
- and ElementSchemaType were not working fine for anySimpleType.
- * XmlSchemaValidator.cs : When actual schema type was complex,
- schema types was not filled correctly. Modified some extra comments.
- * XmlSchemaSet.cs, XmlSchemaType.cs : removed extra MonoTODOs.
-
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlAtomicValue.cs : it won't be implemented since there is no way
- to test it inside sys.xml. Thus remarked MonoTODO.
- * XmlSchemaDatatype.cs : implemented IsDerivedFrom(), which is however
- mostly useless.
-
2006-01-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlSchemaSet.cs : Add() rollbacks IsCompiled to false.
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlAtomicValue.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlAtomicValue.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlAtomicValue.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -36,7 +36,6 @@
namespace System.Xml.Schema
{
- [MonoTODO ("This class is unused and thus won't be finished.")]
public sealed class XmlAtomicValue : XPathItem, ICloneable
{
bool booleanValue;
@@ -54,6 +53,7 @@
#region Constructors
+ [MonoTODO]
internal XmlAtomicValue (bool value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -68,6 +68,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (DateTime value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -82,6 +83,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (decimal value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -96,6 +98,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (double value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -110,6 +113,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (int value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -124,6 +128,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (long value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -138,6 +143,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (float value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -152,6 +158,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (string value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -168,6 +175,7 @@
schemaType = xmlType;
}
+ [MonoTODO]
internal XmlAtomicValue (object value, XmlSchemaType xmlType)
{
Init (value, xmlType);
@@ -273,11 +281,13 @@
return this.Clone ();
}
+ [MonoTODO]
public XmlAtomicValue Clone ()
{
return new XmlAtomicValue (this, schemaType);
}
+ [MonoTODO]
public override object ValueAs (Type type,
IXmlNamespaceResolver nsResolver)
{
switch (XmlTypeCodeFromRuntimeType (type, false)) {
@@ -328,6 +338,7 @@
}
}
+ [MonoTODO]
public override object TypedValue {
get {
switch (ResolvedTypeCode) {
@@ -349,6 +360,7 @@
}
}
+ [MonoTODO]
// This method works like ValueAsString.
public override string Value {
get {
@@ -413,6 +425,7 @@
}
}
+ [MonoTODO]
public override bool ValueAsBoolean {
get {
switch (xmlTypeCode) {
@@ -444,6 +457,7 @@
}
}
+ [MonoTODO]
public override DateTime ValueAsDateTime {
get {
switch (xmlTypeCode) {
@@ -464,6 +478,7 @@
}
}
+ [MonoTODO]
public override double ValueAsDouble {
get {
switch (xmlTypeCode) {
@@ -494,6 +509,7 @@
}
}
+ [MonoTODO]
public override int ValueAsInt {
get {
switch (xmlTypeCode) {
@@ -524,6 +540,7 @@
}
}
+ [MonoTODO]
public override long ValueAsLong {
get {
switch (xmlTypeCode) {
@@ -554,10 +571,12 @@
}
}
+ [MonoTODO]
public override Type ValueType {
get { return schemaType.Datatype.ValueType; }
}
+ [MonoTODO]
public override XmlSchemaType XmlType {
get { return schemaType; }
}
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaAttribute.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -448,13 +448,9 @@
validatedUse = Use;
#if NET_2_0
- if (attributeType != null) {
- attributeSchemaType = attributeType as
XmlSchemaSimpleType;
- if (attributeType ==
XmlSchemaSimpleType.AnySimpleType)
- attributeSchemaType =
XmlSchemaSimpleType.XsAnySimpleType;
- if (attributeSchemaType == null)
- attributeSchemaType =
XmlSchemaType.GetBuiltInSimpleType (SchemaTypeName);
- }
+ attributeSchemaType = attributeType as
XmlSchemaSimpleType;
+ if (attributeSchemaType == null)
+ attributeSchemaType =
XmlSchemaType.GetBuiltInSimpleType (((XmlSchemaDatatype)
attributeType).TypeCode);
#endif
ValidationId = schema.ValidationId;
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaDatatype.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -79,12 +79,10 @@
throw new NotImplementedException ();
}
+ [MonoTODO]
public virtual bool IsDerivedFrom (XmlSchemaDatatype datatype)
{
- // It is documented to return always false, but
- // actually returns true when the argument is for
- // the same type (and it does not check null argument).
- return this == datatype;
+ throw new NotImplementedException ();
}
#endif
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaElement.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -743,13 +743,9 @@
ident.Validate (h, schema);
#if NET_2_0
- if (elementType != null) {
- elementSchemaType = elementType as
XmlSchemaType;
- if (elementType ==
XmlSchemaSimpleType.AnySimpleType)
- elementSchemaType =
XmlSchemaSimpleType.XsAnySimpleType;
- if (elementSchemaType == null)
- elementSchemaType =
XmlSchemaType.GetBuiltInSimpleType (SchemaTypeName);
- }
+ elementSchemaType = elementType as XmlSchemaType;
+ if (elementSchemaType == null && elementType != null)
+ elementSchemaType =
XmlSchemaType.GetBuiltInType (((XmlSchemaDatatype) elementType).TypeCode);
#endif
ValidationId = schema.ValidationId;
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaSet.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -181,6 +181,7 @@
Add (schema);
}
+ [MonoTODO ("We need to research more about the expected
behavior")]
public XmlSchema Add (XmlSchema schema)
{
schemas.Add (schema);
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaType.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -134,6 +134,7 @@
}
#if NET_2_0
+ [MonoTODO]
// LAMESPEC: for IDREFS it returns Idref. for ENTITIES
// it returns Entity. for NMTOKENS it returns NmToken.
[XmlIgnore]
Modified:
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/System.Xml.Schema/XmlSchemaValidator.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -181,8 +181,11 @@
set { xmlResolver = value; }
}
+ [MonoTODO]
public Uri SourceUri {
get { return sourceUri; }
+ // FIXME: actually there seems no setter, but then
+ // it will never make sense.
set { sourceUri = value; }
}
#endregion
@@ -788,7 +791,7 @@
object parsedValue = null;
try {
parsedValue = getter ();
- } catch (Exception ex) { // It is inevitable
and bad manner.
+ } catch (Exception ex) { // FIXME: (wishlist)
It is bad manner ;-(
HandleError ("Attribute value is
invalid against its data type " + dt.TokenizedType, ex);
}
XmlSchemaType type = info != null ?
info.SchemaType : null;
@@ -934,8 +937,8 @@
if (info != null) {
info.IsNil = xsiNilDepth >= 0;
info.SchemaElement = null;
- info.SchemaType = Context.ActualType as
XmlSchemaType;
- if (info.SchemaType == null)
+ info.SchemaType = st;
+ if (st == null)
info.SchemaType =
XmlSchemaType.GetBuiltInSimpleType (dt.TypeCode);
info.SchemaAttribute = null;
info.IsDefault = false; // FIXME: might be true
@@ -978,7 +981,7 @@
if (itemDatatype != null) {
try {
retValues [vi]
= itemDatatype.ParseValue (each, nameTable, nsResolver);
- } catch (Exception ex)
{ // It is inevitable and bad manner.
+ } catch (Exception ex)
{ // FIXME: (wishlist) better exception handling ;-(
HandleError
("List type value contains one or more invalid values.", ex);
break;
}
@@ -1000,7 +1003,7 @@
if (itemDatatype !=
null) {
try {
ret =
itemDatatype.ParseValue (each, nameTable, nsResolver);
- } catch
(Exception) { // It is inevitable and bad manner.
+ } catch
(Exception) { // FIXME: (wishlist) better exception handling ;-(
continue;
}
}
@@ -1045,7 +1048,7 @@
if (validatedDatatype != null) {
try {
ret = validatedDatatype.ParseValue
(value, nameTable, nsResolver);
- } catch (Exception ex) { // It is inevitable
and bad manner.
+ } catch (Exception ex) { // FIXME:
(wishlist) It is bad manner ;-(
HandleError (String.Format ("Invalidly
typed data was specified."), ex);
}
}
@@ -1229,7 +1232,7 @@
if (dt != null) {
try {
identity =
dt.ParseValue (value, nameTable, nsResolver);
- } catch (Exception ex) { // It
is inevitable and bad manner.
+ } catch (Exception ex) { //
FIXME: (wishlist) This is bad manner ;-(
HandleError ("Identity
value is invalid against its data type " + dt.TokenizedType, ex);
}
}
@@ -1391,7 +1394,7 @@
for (int i = 0; i < tmp.Length; i += 2) {
try {
schema = ReadExternalSchema (tmp [i +
1]);
- } catch (Exception ex) { // It is inevitable
and bad manner.
+ } catch (Exception ex) { // FIXME: (wishlist)
It is bad manner ;-(
HandleError ("Could not resolve schema
location URI: " + schemaLocation, ex, true);
continue;
}
@@ -1420,7 +1423,7 @@
try {
schema = ReadExternalSchema
(noNsSchemaLocation);
- } catch (Exception ex) { // It is inevitable and bad
manner.
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad
manner ;-(
HandleError ("Could not resolve schema location
URI: " + noNsSchemaLocation, ex, true);
}
if (schema != null && schema.TargetNamespace != null)
Modified: tags/mono-1-1-13/mcs/class/System.XML/System.Xml_test.dll.sources
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/System.Xml_test.dll.sources
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/System.Xml_test.dll.sources
2006-01-15 03:24:19 UTC (rev 55590)
@@ -44,13 +44,9 @@
System.Xml/nist_dom/fundamental/NamedNodeMap/NamedNodeMap.cs
System.Xml/nist_dom/fundamental/NodeList/NodeList.cs
System.Xml/nist_dom/fundamental/Text/Text.cs
-System.Xml.Schema/XmlSchemaAssertion.cs
-System.Xml.Schema/XmlSchemaBuiltInDatatypeTests.cs
-System.Xml.Schema/XmlSchemaDatatypeTests.cs
-System.Xml.Schema/XmlSchemaLengthFacetTests.cs
System.Xml.Schema/XmlSchemaTests.cs
-System.Xml.Schema/XmlSchemaTypeTests.cs
System.Xml.Schema/XmlSchemaSetTests.cs
+System.Xml.Schema/XmlSchemaLengthFacetTests.cs
System.Xml.Serialization/ComplexDataStructure.cs
System.Xml.Serialization/DeserializeTests.cs
System.Xml.Serialization/SoapAttributeAttributeTests.cs
@@ -74,6 +70,8 @@
System.Xml.Serialization/XmlSerializationWriterTests.cs
System.Xml.Serialization/XmlTextAttributeTests.cs
System.Xml.Serialization/XmlTypeAttributeTests.cs
+System.Xml.Schema/XmlSchemaAssertion.cs
+System.Xml.Schema/XmlSchemaBuiltInDatatypeTests.cs
System.Xml.Serialization/XmlSerializerTests.cs
System.Xml.Serialization/XmlSerializerTestClasses.cs
System.Xml.XPath/SelectNodesTests.cs
Modified: tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/ChangeLog
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/ChangeLog
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,17 +1,3 @@
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlTextWriterTests.cs : Split AutoCreatePrefixes() and marked as
- Ignore rather than NotWorking. Also it is not for bug #77086 and
- #77077 (they were fixed). See bug #77088.
-
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlTextWriterTests.cs : re-enabled WriteNmToken_InvalidChars().
-
-2006-01-12 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlTextWriterTests.cs : re-enabled bug #77094 related tests.
-
2006-01-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlWriterTests.cs : added tests for WriteNode(XPathNavigator, bool)
Modified:
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml/XmlTextWriterTests.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -205,26 +205,29 @@
}
[Test]
- [Ignore ("Due to the (silly) dependency on bug #77088, this
test will not be fixed. The test could be rewritten but it depends on the
original test author.")]
+ [Category ("NotWorking")] // bug #77086, #77087 and #77088
public void AutoCreatePrefixes ()
{
- xtw.WriteStartElement ("root");
xtw.WriteAttributeString (null, "abc",
"http://somenamespace.com", "http://abc.def");
xtw.WriteAttributeString (null, "def",
"http://somenamespace.com", "http://def.ghi");
xtw.WriteAttributeString (null, "ghi",
"http://othernamespace.com", "http://ghi.jkl");
- xtw.WriteEndElement ();
- Assert.AreEqual ("<root d1p1:abc='http://abc.def'
d1p1:def='http://def.ghi' d1p2:ghi='http://ghi.jkl'
xmlns:d1p2='http://othernamespace.com' xmlns:d1p1='http://somenamespace.com'
/>", StringWriterText, "#1");
- }
+#if NET_2_0
+ Assert.AreEqual ("d0p1:abc='http://abc.def'
d0p1:def='http://def.ghi'" +
+ " d0p2:ghi='http://ghi.jkl'", StringWriterText,
"#1");
+#else
+ // on 1.x a new prefix is always created when level is
0 ?
+ Assert.AreEqual ("d0p1:abc='http://abc.def'
d0p2:def='http://def.ghi'" +
+ " d0p3:ghi='http://ghi.jkl'", StringWriterText,
"#1");
+#endif
- [Test]
- [Ignore ("Due to the (silly) dependency on bug #77088, this
test will not be fixed. The test could be rewritten but it depends on the
original test author.")]
- public void AutoCreatePrefixes2 ()
- {
+ sw.GetStringBuilder ().Length = 0;
+ CreateXmlTextWriter ();
+
xtw.WriteStartElement ("person");
- xtw.WriteAttributeString (null, "name",
"http://somenamespace.com", "Driesen");
- xtw.WriteAttributeString (null, "initials",
"http://othernamespace.com", "GD");
- xtw.WriteAttributeString (null, "firstName",
"http://somenamespace.com", "Gert");
+ xtw.WriteAttributeString (null, "name",
"http://somenamespace.com", "Gates");
+ xtw.WriteAttributeString (null, "initials",
"http://othernamespace.com", "BG");
+ xtw.WriteAttributeString (null, "firstName",
"http://somenamespace.com", "Bill");
xtw.WriteStartElement ("address");
xtw.WriteAttributeString (null, "street",
"http://somenamespace.com", "Campus");
xtw.WriteAttributeString (null, "number",
"http://othernamespace.com", "1");
@@ -235,9 +238,9 @@
Assert.AreEqual (
"<person" +
- " d1p1:name='Driesen'" +
- " d1p2:initials='GD'" +
- " d1p1:firstName='Gert'" +
+ " d1p1:name='Gates'" +
+ " d1p2:initials='BG'" +
+ " d1p1:firstName='Bill'" +
"
xmlns:d1p2='http://othernamespace.com'" +
"
xmlns:d1p1='http://somenamespace.com'>" +
"<address" +
@@ -522,8 +525,12 @@
}
[Test]
+ [Category ("NotWorking")]
public void WriteStartElement_XmlPrefix ()
{
+ // uncomment the next code block once bug #77094 has
been fixed.
+
+ /*
xtw.WriteStartElement ("xml", "something",
"http://www.w3.org/XML/1998/namespace");
Assert.AreEqual ("<xml:something", StringWriterText,
"#1");
@@ -541,6 +548,7 @@
sw.GetStringBuilder ().Length = 0;
CreateXmlTextWriter ();
+ */
}
[Test]
@@ -551,6 +559,7 @@
}
[Test]
+ [Category ("NotWorking")] // bug #77094
[ExpectedException (typeof (ArgumentException))]
public void WriteStartElement_XmlPrefix_Invalid2 ()
{
@@ -1527,6 +1536,7 @@
}
[Test]
+ [Category ("NotWorking")] // on mono, an XmlException is thrown
instead
[ExpectedException (typeof (ArgumentException))]
public void WriteNmToken_InvalidChars ()
{
Modified: tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/ChangeLog
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,17 +1,3 @@
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlSchemaTypeTests.cs : new file. Test for TypeCode.
- * XmlSchemaSetTests.cs : added more tests for Add() and marked one as
- NotWorking (we need info on how consistent this method is).
-
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlSchemaDatatypeTests.cs : oops sys.col.generic is NET_2_0.
-
-2006-01-10 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * XmlSchemaDatatypeTests.cs : added test for 2.0 IsDerivedFrom().
-
2006-01-06 Atsushi Enomoto <[EMAIL PROTECTED]>
* XmlSchemaSetTests.cs : added AddRollbackIsCompiled(); Add() changes
Modified:
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaDatatypeTests.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -11,16 +11,8 @@
using System.IO;
using System.Xml;
using System.Xml.Schema;
-#if NET_2_0
-using System.Collections.Generic;
-#endif
using NUnit.Framework;
-using QName = System.Xml.XmlQualifiedName;
-using SimpleType = System.Xml.Schema.XmlSchemaSimpleType;
-using SimpleRest = System.Xml.Schema.XmlSchemaSimpleTypeRestriction;
-using AssertType = NUnit.Framework.Assert;
-
namespace MonoTests.System.Xml
{
[TestFixture]
@@ -47,7 +39,6 @@
}
[Test]
- [Category ("NotWorking")] // ContentTypeParticle impl.
difference.
public void TestAnyType ()
{
XmlSchema schema = GetSchema
("Test/XmlFiles/xsd/datatypesTest.xsd");
@@ -80,80 +71,5 @@
// AssertDatatype (schema, 6, XmlTokenizedType.NMTOKEN,
typeof (string []), "f o o", new string [] {"f", "o", "o"});
}
-#if NET_2_0
- string [] allTypes = new string [] {
- "string", "boolean", "float", "double", "decimal",
- "duration", "dateTime", "time", "date", "gYearMonth",
- "gYear", "gMonthDay", "gDay", "gMonth", "hexBinary",
- "base64Binary", "anyURI", "QName", "NOTATION",
- "normalizedString", "token", "language", "IDREFS",
- "ENTITIES", "NMTOKEN", "NMTOKENS", "Name", "NCName",
- "ID", "IDREF", "ENTITY", "integer",
- "nonPositiveInteger", "negativeInteger", "long",
- "int", "short", "byte", "nonNegativeInteger",
- "unsignedLong", "unsignedInt", "unsignedShort",
- "unsignedByte", "positiveInteger"
- };
-
- XmlSchemaSet allWrappers;
-
- void SetupSimpleTypeWrappers ()
- {
- XmlSchema schema = new XmlSchema ();
- List<QName> qnames = new List<QName> ();
- foreach (string name in allTypes) {
- SimpleType st = new SimpleType ();
- st.Name = "x-" + name;
- SimpleRest r = new SimpleRest ();
- st.Content = r;
- QName qname = new QName (name,
XmlSchema.Namespace);
- r.BaseTypeName = qname;
- qnames.Add (qname);
- schema.Items.Add (st);
- }
- XmlSchemaSet sset = new XmlSchemaSet ();
- sset.Add (schema);
- sset.Compile ();
- allWrappers = sset;
- }
-
- XmlSchemaDatatype GetDatatype (string name)
- {
- return (allWrappers.GlobalTypes [new QName ("x-" + name,
- String.Empty)] as SimpleType).Datatype;
- }
-
- string [] GetDerived (string target)
- {
- XmlSchemaDatatype strType = GetDatatype (target);
- List<string> results = new List<string> ();
- foreach (string name in allTypes) {
- if (name == target)
- continue;
- XmlSchemaDatatype deriv = GetDatatype (name);
- if (deriv.IsDerivedFrom (strType))
- results.Add (name);
- else Console.Error.WriteLine (deriv.GetType ()
+ " is not derived from " + strType.GetType ());
- }
- return results.ToArray ();
- }
-
- [Test]
- public void IsDerivedFrom ()
- {
- SetupSimpleTypeWrappers ();
-
- // Funky, but XmlSchemaDatatype.IsDerivedFrom() is
- // documented to always return false, but actually
- // matches the same type - which could be guessed that
- // this method is used only to detect user-defined
- // simpleType derivation.
- foreach (string b in allTypes)
- foreach (string d in allTypes)
- AssertType.AreEqual (b == d,
GetDatatype (d).IsDerivedFrom (GetDatatype (b)), b);
-
- AssertType.IsFalse (GetDatatype
("string").IsDerivedFrom (null), "null arg");
- }
-#endif
}
}
Modified:
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaSetTests.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaSetTests.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaSetTests.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -56,22 +56,9 @@
}
[Test]
- public void AddSchemaThenReader ()
- {
- XmlSchemaSet ss = new XmlSchemaSet ();
- XmlDocument doc = new XmlDocument ();
- doc.LoadXml ("<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' />");
- XmlSchema xs = new XmlSchema ();
- xs.TargetNamespace = "ab";
- ss.Add (xs);
- ss.Add ("ab", new XmlNodeReader (doc));
- }
-
- [Test]
- [Category ("NotWorking")] // How can we differentiate this
- // case and the testcase above?
+ [Ignore ("This behavior might be changed, since Add(XmlSchema)
does not throw any exceptions, while this does.")]
[ExpectedException (typeof (ArgumentException))]
- public void AddReaderTwice ()
+ public void AddTwice ()
{
XmlSchemaSet ss = new XmlSchemaSet ();
XmlDocument doc = new XmlDocument ();
@@ -81,16 +68,6 @@
}
[Test]
- public void AddSchemaTwice ()
- {
- XmlSchemaSet ss = new XmlSchemaSet ();
- XmlDocument doc = new XmlDocument ();
- doc.LoadXml ("<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:ab' />");
- ss.Add (XmlSchema.Read (new XmlNodeReader (doc), null));
- ss.Add (XmlSchema.Read (new XmlNodeReader (doc), null));
- }
-
- [Test]
public void CompilationSettings ()
{
Assert.IsNotNull (new XmlSchemaSet
().CompilationSettings);
Deleted:
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTypeTests.cs
===================================================================
---
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTypeTests.cs
2006-01-15 01:21:30 UTC (rev 55589)
+++
tags/mono-1-1-13/mcs/class/System.XML/Test/System.Xml.Schema/XmlSchemaTypeTests.cs
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,101 +0,0 @@
-//
-// System.Xml.XmlSchemaSetTests.cs
-//
-// Author:
-// Atsushi Enomoto <[EMAIL PROTECTED]>
-//
-// (C) 2004 Novell Inc.
-//
-
-using System;
-using System.Collections;
-using System.IO;
-using System.Xml;
-using System.Xml.Schema;
-using NUnit.Framework;
-
-using QName = System.Xml.XmlQualifiedName;
-using SimpleType = System.Xml.Schema.XmlSchemaSimpleType;
-using SimpleRest = System.Xml.Schema.XmlSchemaSimpleTypeRestriction;
-using AssertType = NUnit.Framework.Assert;
-
-namespace MonoTests.System.Xml
-{
- [TestFixture]
- public class XmlSchemaTypeTests
- {
-#if NET_2_0
- string [] all_types = new string [] {
- "string", "boolean", "float", "double", "decimal",
- "duration", "dateTime", "time", "date", "gYearMonth",
- "gYear", "gMonthDay", "gDay", "gMonth", "hexBinary",
- "base64Binary", "anyURI", "QName", "NOTATION",
- "normalizedString", "token", "language", "IDREFS",
- "ENTITIES", "NMTOKEN", "NMTOKENS", "Name", "NCName",
- "ID", "IDREF", "ENTITY", "integer",
- "nonPositiveInteger", "negativeInteger", "long",
- "int", "short", "byte", "nonNegativeInteger",
- "unsignedLong", "unsignedInt", "unsignedShort",
- "unsignedByte", "positiveInteger"
- };
-
- XmlTypeCode [] type_codes = new XmlTypeCode [] {
- XmlTypeCode.String,
- XmlTypeCode.Boolean,
- XmlTypeCode.Float,
- XmlTypeCode.Double,
- XmlTypeCode.Decimal,
- XmlTypeCode.Duration,
- XmlTypeCode.DateTime,
- XmlTypeCode.Time,
- XmlTypeCode.Date,
- XmlTypeCode.GYearMonth,
- XmlTypeCode.GYear,
- XmlTypeCode.GMonthDay,
- XmlTypeCode.GDay,
- XmlTypeCode.GMonth,
- XmlTypeCode.HexBinary,
- XmlTypeCode.Base64Binary,
- XmlTypeCode.AnyUri,
- XmlTypeCode.QName,
- XmlTypeCode.Notation,
- XmlTypeCode.NormalizedString,
- XmlTypeCode.Token,
- XmlTypeCode.Language,
- XmlTypeCode.Idref, // IDREFS (LAMESPEC)
- XmlTypeCode.Entity, // ENTITIES (LAMESPEC)
- XmlTypeCode.NmToken,
- XmlTypeCode.NmToken, // NMTOKENS (LAMESPEC)
- XmlTypeCode.Name,
- XmlTypeCode.NCName,
- XmlTypeCode.Id,
- XmlTypeCode.Idref,
- XmlTypeCode.Entity,
- XmlTypeCode.Integer,
- XmlTypeCode.NonPositiveInteger,
- XmlTypeCode.NegativeInteger,
- XmlTypeCode.Long,
- XmlTypeCode.Int,
- XmlTypeCode.Short,
- XmlTypeCode.Byte,
- XmlTypeCode.NonNegativeInteger,
- XmlTypeCode.UnsignedLong,
- XmlTypeCode.UnsignedInt,
- XmlTypeCode.UnsignedShort,
- XmlTypeCode.UnsignedByte,
- XmlTypeCode.PositiveInteger};
-
- [Test]
- public void TypeCode ()
- {
- for (int i = 0; i < all_types.Length; i++) {
- string name = all_types [i];
- QName qname = new QName (name,
XmlSchema.Namespace);
- Assert.AreEqual (type_codes [i],
- XmlSchemaType.GetBuiltInSimpleType
(qname).TypeCode, name);
- }
- }
-
-#endif
- }
-}
Modified: tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/ChangeLog
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/ChangeLog
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/ChangeLog
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,7 +1,3 @@
-2006-01-11 Atsushi Enomoto <[EMAIL PROTECTED]>
-
- * datatypesTest.xsd : missing required file for xsd tests.
-
2005-12-26 Atsushi Enomoto <[EMAIL PROTECTED]>
* multi-schemaLocation.xml,
Deleted:
tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/datatypesTest.xsd
===================================================================
--- tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/datatypesTest.xsd
2006-01-15 01:21:30 UTC (rev 55589)
+++ tags/mono-1-1-13/mcs/class/System.XML/Test/XmlFiles/xsd/datatypesTest.xsd
2006-01-15 03:24:19 UTC (rev 55590)
@@ -1,11 +0,0 @@
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns="urn:bar" targetNamespace="urn:bar">
- <xs:element name="e00">
- <xs:complexType>
- </xs:complexType>
- </xs:element>
- <xs:element name="e4" type="xs:string" />
- <xs:element name="e1" type="xs:normalizedString" />
- <xs:element name="e2" type="xs:token" />
- <xs:element name="e3" type="xs:language" />
-</xs:schema>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches