public static XPointerSchemaPointerPart ParseSchemaData(XPointerLexer lexer)
		{
			try
			{
				return new XPointerSchemaPointerPart(lexer.ParseEscapedData());
			}
			catch (Exception e)
			{
				throw new XPointerSyntaxException(String.Format(CultureInfo.CurrentCulture, Properties.Resources.SyntaxErrorInXPointerSchemeData, e.Message));
			}
		}
Example #2
0
		public static XmlnsSchemaPointerPart ParseSchemaData(XPointerLexer lexer)
		{
			//[1]   	XmlnsSchemeData	   ::=   	 NCName S? '=' S? EscapedNamespaceName
			//[2]   	EscapedNamespaceName	   ::=   	EscapedData*                      	                    
			//Read prefix as NCName
			lexer.NextLexeme();
			if (lexer.Kind != XPointerLexer.LexKind.NCName)
			{
				Debug.WriteLine(Properties.Resources.InvalidTokenInXmlnsSchemeWhileNCNameExpected);
				return null;
			}
			string prefix = lexer.NCName;
			lexer.SkipWhiteSpace();
			lexer.NextLexeme();
			if (lexer.Kind != XPointerLexer.LexKind.Eq)
			{				
				Debug.WriteLine(Properties.Resources.InvalidTokenInXmlnsSchemeWhileEqualsSignExpected);
				return null;
			}
			lexer.SkipWhiteSpace();
			string nsURI;
			try
			{
				nsURI = lexer.ParseEscapedData();
			}
			catch (Exception e)
			{
				throw new XPointerSyntaxException(String.Format(CultureInfo.CurrentCulture, Properties.Resources.SyntaxErrorInXmlnsSchemeData, e.Message));
			}
			return new XmlnsSchemaPointerPart(prefix, nsURI);
		}