* BuiltInDatatypes.cs : Fixed whitespace facet in XsdToken.
Tokenized type of nmtokens and entities is string [].
* XmlSchema.cs : Changed IsCompile implementation a bit.
Compile() should reset compiled contents.
* XmlSchemaDatatype.cs : Fixed collapsing Normalize().
* XmlSchemaObject.cs : added CompilationId initialization.
svn path=/trunk/mcs/; revision=17164
{\r
internal XsdToken ()\r
{\r
+ this.WhitespaceValue = XsdWhitespaceFacet.Collapse;\r
}\r
\r
public override XmlTokenizedType TokenizedType {\r
get { return typeof (string []); }\r
}\r
\r
- // ParseValue () method is as same as that of xs:string\r
+ readonly char [] whitespaceArray = new char [] {' '};\r
+ public override object ParseValue (string value, XmlNameTable nt, XmlNamespaceManager nsmgr)\r
+ {\r
+ return this.Normalize (value).Split (whitespaceArray);\r
+ }\r
}\r
\r
// xs:Name\r
get { return typeof (string []); }\r
}\r
\r
- // ParseValue () method is as same as that of xs:string\r
+ readonly char [] whitespaceArray = new char [] {' '};\r
+ public override object ParseValue (string value, XmlNameTable nt, XmlNamespaceManager nsmgr)\r
+ {\r
+ return this.Normalize (value).Split (whitespaceArray);\r
+ }\r
}\r
\r
// xs:NOTATION\r
+2003-08-07 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
+
+ * BuiltInDatatypes.cs : Fixed whitespace facet in XsdToken.
+ Tokenized type of nmtokens and entities is string [].
+ * XmlSchema.cs : Changed IsCompile implementation a bit.
+ Compile() should reset compiled contents.
+ * XmlSchemaDatatype.cs : Fixed collapsing Normalize().
+ * XmlSchemaObject.cs : added CompilationId initialization.
+
2003-08-05 Lluis Sanchez Gual <lluis@ximian.com>
* XmlSchema.cs: Set IsCompiled to true after compiling.
[XmlIgnore]\r
public bool IsCompiled\r
{\r
- get{ return isCompiled;}\r
+ get{ return this.CompilationId != Guid.Empty;}\r
}\r
\r
[XmlIgnore]\r
schemas = new XmlSchemaCollection ();\r
schemas.Add (this);\r
\r
+ attributeGroups = new XmlSchemaObjectTable ();\r
+ attributes = new XmlSchemaObjectTable ();\r
+ elements = new XmlSchemaObjectTable ();\r
+ groups = new XmlSchemaObjectTable ();\r
+ missingElementTypeRefs.Clear ();\r
+ missingBaseSchemaTypeRefs.Clear ();\r
+ notations = new XmlSchemaObjectTable ();\r
+ schemaTypes = new XmlSchemaObjectTable ();\r
+\r
//1. Union and List are not allowed in block default\r
if(BlockDefault != XmlSchemaDerivationMethod.All)\r
{\r
\r
char [] wsChars = new char [] {' ', '\t', '\n', '\r'};\r
\r
+ StringBuilder sb = new StringBuilder ();\r
internal string Normalize (string s)\r
{\r
switch (Whitespace) {\r
case XsdWhitespaceFacet.Collapse:\r
- return String.Join (" ", s.Trim ().Split (wsChars));\r
+ string [] arr = s.Trim ().Split (wsChars);\r
+ foreach (string one in arr)\r
+ if (one != "") {\r
+ sb.Append (one);\r
+ sb.Append (" ");\r
+ }\r
+ string result = sb.ToString ();\r
+ sb.Length = 0;\r
+ return result.Trim ();\r
case XsdWhitespaceFacet.Replace:\r
- StringBuilder sb = new StringBuilder (s);\r
+ sb.Length = 0;\r
+ sb.Append (s);\r
sb.Replace ('\r', ' ');\r
sb.Replace ('\n', ' ');\r
sb.Replace ('\t', ' ');\r
- string result = sb.ToString ();\r
+ result = sb.ToString ();\r
sb.Length = 0;\r
return result;\r
default:\r
{\r
namespaces = new XmlSerializerNamespaces();\r
unhandledAttributeList = null;\r
+ CompilationId = Guid.Empty;\r
}\r
\r
[XmlIgnore]\r