4 namespace System.Xml.Schema
\r
7 /// Summary description for XmlSchemaUtil.
\r
9 public class XmlSchemaUtil
\r
11 private XmlSchemaUtil()
\r
15 public static bool CheckID(string id)
\r
17 //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#ID
\r
18 // 1. ID must be a NCName
\r
19 // 2. ID must be unique in the schema
\r
20 if(!CheckNCName(id))
\r
27 public static bool CheckAnyUri(string uri)
\r
29 //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#anyURI
\r
32 public static bool CheckToken(string token)
\r
34 //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#token
\r
37 public static bool CheckLanguage(string lang)
\r
39 //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#language
\r
42 public static bool CheckNCName(string name)
\r
44 //check if the string conforms to http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#NCName
\r
47 XmlConvert.VerifyNCName(name);
\r
55 public static string[] SplitList(string ns)
\r
57 return ns.Split(new char[]{' '});
\r
61 public static XmlQualifiedName GetRandomQName()
\r
63 return new XmlQualifiedName(new Random().Next(int.MaxValue).ToString());
\r