public static string VerifyTOKEN(string token) { if (token == null) { throw new ArgumentNullException("token"); } if (token.Length == 0) { return(token); } if (XmlChar.IsWhitespace(token [0]) || XmlChar.IsWhitespace(token [token.Length - 1])) { throw new XmlException("Whitespace characters (#xA, #xD, #x9, #x20) are not allowed as leading or trailing whitespaces of xs:token."); } for (int i = 0; i < token.Length; i++) { if (XmlChar.IsWhitespace(token [i]) && token [i] != ' ') { throw new XmlException("Either #xA, #xD or #x9 are not allowed inside xs:token."); } } return(token); }
public static string VerifyWhitespace(string content) { if (content == null) { throw new ArgumentNullException("content"); } if (XmlChar.IsWhitespace(content)) { return(content); } throw new XmlException(string.Format("'{0}' is not whitespace", content)); }
public static bool IsWhitespaceChar(char ch) { return(XmlChar.IsWhitespace(ch)); }