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)); }
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(Monobjc.Tools.Sdp.Properties.Resources.InvalidTokenInXmlnsSchemeWhileNCNameExpected); return null; } string prefix = lexer.NCName; lexer.SkipWhiteSpace(); lexer.NextLexeme(); if (lexer.Kind != XPointerLexer.LexKind.Eq) { Debug.WriteLine(Monobjc.Tools.Sdp.Properties.Resources.InvalidTokenInXmlnsSchemeWhileEqualsSignExpected); return null; } lexer.SkipWhiteSpace(); string nsURI; try { nsURI = lexer.ParseEscapedData(); } catch (Exception e) { throw new XPointerSyntaxException(String.Format(CultureInfo.CurrentCulture, Monobjc.Tools.Sdp.Properties.Resources.SyntaxErrorInXmlnsSchemeData, e.Message)); } return new XmlnsSchemaPointerPart(prefix, nsURI); }
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(SR.InvalidTokenInXmlnsSchemeWhileNCNameExpected); return null; } string prefix = lexer.NCName; lexer.SkipWhiteSpace(); lexer.NextLexeme(); if (lexer.Kind != XPointerLexer.LexKind.Eq) { Debug.WriteLine(SR.InvalidTokenInXmlnsSchemeWhileEqualsSignExpected); return null; } lexer.SkipWhiteSpace(); string nsURI; try { nsURI = lexer.ParseEscapedData(); } catch (Exception e) { throw new XPointerSyntaxException(SR.GetString("SyntaxErrorInXmlnsSchemeData", e.Message)); } return new XmlnsSchemaPointerPart(prefix, nsURI); }