예제 #1
0
        private void ParseAttributeType(char ch, AttributeDefinition attr)
        {
            if (ch == '%')
            {
                Entity e = ParseParameterEntity(_whiteSpace);

                PushEntity(_current.ResolvedUri, e);
                ParseAttributeType(_current.LastChar, attr);
                PopEntity();

                ch = _current.LastChar;
                return;
            }

            if (ch == '(')
            {
                attr.SetEnumeratedType(ParseNameGroup(ch, false), AttributeType.Enumeration);
            }
            else
            {
                string token = ScanName(_whiteSpace);
                if (String.Compare(token, "NOTATION", true, CultureInfo.InvariantCulture) == 0)
                {
                    ch = _current.SkipWhitespace();
                    if (ch != '(')
                    {
                        throw Error.ExpectingNameGroup(ch);
                    }

                    attr.SetEnumeratedType(ParseNameGroup(ch, true), AttributeType.Notation);
                }
                else
                {
                    attr.SetType(token);
                }
            }
        }
예제 #2
0
        private void ParseAttributeType(char ch, AttributeDefinition attr)
        {
            if (ch == '%')
            {
                Entity e = ParseParameterEntity(_whiteSpace);
                
                PushEntity(_current.ResolvedUri, e);
                ParseAttributeType(_current.LastChar, attr);
                PopEntity();

                ch = _current.LastChar;
                return;
            }

            if (ch == '(')
            {
                attr.SetEnumeratedType(ParseNameGroup(ch, false), AttributeType.Enumeration);
            }
            else
            {
                string token = ScanName(_whiteSpace);
                if (String.Compare(token, "NOTATION", true, CultureInfo.InvariantCulture) == 0)
                {
                    ch = _current.SkipWhitespace();
                    if (ch != '(')
                        throw Error.ExpectingNameGroup(ch);
                    
                    attr.SetEnumeratedType(ParseNameGroup(ch, true), AttributeType.Notation);
                }
                else
                    attr.SetType(token);
            }
        }