Beispiel #1
0
        private    void Push(DtdFunctionIndex func) {
            DtdParseState s = (DtdParseState)_ParseStack.Push();
            if (s == null) {
                s = new DtdParseState();
                _ParseStack[_ParseStack.Length-1] = s;
            }

            // save the current function and its substate on the stack
            s._FuncIndex = _DtdFuncIndex;
            s._State = _SubState;

            // new dtd function and substate in the function
            _DtdFuncIndex = func;
            _SubState = 0;
        }
Beispiel #2
0
        private    void Pop() {
            DtdParseState s = (DtdParseState)_ParseStack.Pop();

            // restore the previous function and its state
            _DtdFuncIndex = s._FuncIndex;
            _SubState = s._State;
        }
Beispiel #3
0
        internal DtdParser(XmlScanner pScanner,
                           XmlReader reader,
                           XmlResolver res,
                           XmlNameTable nameTable,
                           ValidationEventHandler validationEventHandler,
                           bool namespaces) {
            _NameTable = nameTable;
            _SchemaNames = new SchemaNames(nameTable);
            _NsMgr = new XmlNamespaceManager(_NameTable);
            _Scanner = _XmlScanner = pScanner;
            _Scanner.InDTD = true;
            _XmlResolver = res;
            _Namespaces = namespaces;

            _Reader = reader;
            _ValidationEventHandler = validationEventHandler;
            _InternalValidationEventHandler = new ValidationEventHandler(InternalValidationCallback);
            _SchemaInfo = new SchemaInfo(_SchemaNames);
            _SchemaInfo.SchemaType = SchemaType.DTD;
            _DtdFuncIndex = DtdFunctionIndex.ParseDocTypeDecl;
            _IsInternal = true;
            _ParseStack = new HWStack(STACK_INCREMENT);
            _ScannerStack = new HWStack(STACK_INCREMENT);
            _GroupStack = new HWStack(STACK_INCREMENT);
            _StringBuilder = new StringBuilder();
            _L = -2;
            if (_XmlResolver != null && reader.BaseURI != string.Empty) {
                _BaseUri = _XmlResolver.ResolveUri(null, reader.BaseURI);
                _DocBaseUri = XmlUrlResolver.UnEscape(_BaseUri.ToString());
            }
            Push(DtdFunctionIndex.ParseDocTypeDecl);
        }