Наследование: ICloneable
Пример #1
0
        /// <include file='doc\XmlNamespaceManager.uex' path='docs/doc[@for="XmlNamespaceManager.XmlNamespaceManager"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public XmlNamespaceManager(XmlNameTable nameTable) {
            this.nameTable = nameTable;
            namespaceXml = nameTable.Add(XmlReservedNs.NsXml);
            namespaceXmlNs = nameTable.Add(XmlReservedNs.NsXmlNs);       
            xml = nameTable.Add("xml");
            xmlNs = nameTable.Add("xmlns");       

            decls = new HWStack(60);
            scopes = new HWStack(60);
            defaultNs = null;
            count = 0;
        }
        /// <include file='doc\XmlNamespaceManager.uex' path='docs/doc[@for="XmlNamespaceManager.XmlNamespaceManager"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public XmlNamespaceManager(XmlNameTable nameTable)
        {
            this.nameTable = nameTable;
            namespaceXml   = nameTable.Add(XmlReservedNs.NsXml);
            namespaceXmlNs = nameTable.Add(XmlReservedNs.NsXmlNs);
            xml            = nameTable.Add("xml");
            xmlNs          = nameTable.Add("xmlns");

            decls     = new HWStack(60);
            scopes    = new HWStack(60);
            defaultNs = null;
            count     = 0;
        }
        internal OutputScopeManager(XmlNameTable nameTable, OutKeywords atoms) {
            Debug.Assert(nameTable != null);
            Debug.Assert(atoms     != null);

            this.elementScopesStack = new HWStack(STACK_INCREMENT);
            this.nameTable          = nameTable;
            this.atoms              = atoms;
            this.defaultNS          = this.atoms.Empty;

            // We always adding rootElementScope to garantee that CurrentElementScope != null
            // This context is active between PI and first element for example
            OutputScope rootElementScope = (OutputScope) this.elementScopesStack.Push();
            if(rootElementScope == null) {
                rootElementScope = new OutputScope();
                this.elementScopesStack.AddToTop(rootElementScope);
            }
            rootElementScope.Init(string.Empty, string.Empty, string.Empty, /*space:*/XmlSpace.None, /*lang:*/string.Empty, /*mixed:*/false);
        }
 internal XdrBuilder(XmlReader reader, XmlNamespaceManager curmgr, SchemaInfo sinfo, string targetNamspace, XmlNameTable nameTable, SchemaNames schemaNames, ValidationEventHandler eventhandler)
 {
     this._SchemaInfo = sinfo;
     this._TargetNamespace = targetNamspace;
     this._reader = reader;
     this._CurNsMgr = curmgr;
     this.validationEventHandler = eventhandler;
     this._StateHistory = new HWStack(10);
     this._ElementDef = new ElementContent();
     this._AttributeDef = new AttributeContent();
     this._GroupStack = new HWStack(10);
     this._GroupDef = new GroupContent();
     this._NameTable = nameTable;
     this._SchemaNames = schemaNames;
     this._CurState = S_SchemaEntries[0];
     this.positionInfo = PositionInfo.GetPositionInfo(this._reader);
     this.xmlResolver = new XmlUrlResolver();
 }
 private void Init()
 {
     this.validationStack = new HWStack(10);
     this.attPresence = new Hashtable();
     this.Push(XmlQualifiedName.Empty);
     this.dummyPositionInfo = new PositionInfo();
     this.positionInfo = this.dummyPositionInfo;
     this.validationEventSender = this;
     this.currentState = ValidatorState.None;
     this.textValue = new StringBuilder(100);
     this.xmlResolver = new XmlUrlResolver();
     this.contextQName = new XmlQualifiedName();
     this.Reset();
     this.RecompileSchemaSet();
     this.NsXs = this.nameTable.Add("http://www.w3.org/2001/XMLSchema");
     this.NsXsi = this.nameTable.Add("http://www.w3.org/2001/XMLSchema-instance");
     this.NsXmlNs = this.nameTable.Add("http://www.w3.org/2000/xmlns/");
     this.NsXml = this.nameTable.Add("http://www.w3.org/XML/1998/namespace");
     this.xsiTypeString = this.nameTable.Add("type");
     this.xsiNilString = this.nameTable.Add("nil");
     this.xsiSchemaLocationString = this.nameTable.Add("schemaLocation");
     this.xsiNoNamespaceSchemaLocationString = this.nameTable.Add("noNamespaceSchemaLocation");
 }
        private void Init() {
            validationStack = new HWStack(STACK_INCREMENT);
            attPresence = new Hashtable();
            Push(XmlQualifiedName.Empty);

            dummyPositionInfo = new PositionInfo(); //Dummy position info, will return (0,0) if user does not set the LineInfoProvider property
            positionInfo = dummyPositionInfo;
            validationEventSender = this;
            currentState = ValidatorState.None;
            textValue = new StringBuilder(100);
            xmlResolver = System.Xml.XmlConfiguration.XmlReaderSection.CreateDefaultResolver();
            contextQName = new XmlQualifiedName(); //Re-use qname
            Reset();

            RecompileSchemaSet(); //Gets compiled info from set as well
            //Get already Atomized strings
            NsXs = nameTable.Add(XmlReservedNs.NsXs);
            NsXsi = nameTable.Add(XmlReservedNs.NsXsi);
            NsXmlNs = nameTable.Add(XmlReservedNs.NsXmlNs);
            NsXml = nameTable.Add(XmlReservedNs.NsXml);
            xsiTypeString = nameTable.Add("type");
            xsiNilString = nameTable.Add("nil");
            xsiSchemaLocationString = nameTable.Add("schemaLocation");
            xsiNoNamespaceSchemaLocationString = nameTable.Add("noNamespaceSchemaLocation");
        }
 private void Init()
 {
     this.validationStack = new HWStack(10);
     base.textValue = new StringBuilder();
     this.name = XmlQualifiedName.Empty;
     this.attPresence = new Hashtable();
     base.schemaInfo = new SchemaInfo();
     base.checkDatatype = false;
     this.Push(this.name);
 }
Пример #8
0
 protected virtual void Init()
 {
     _state = State.Initial;
     _stack = new HWStack<SgmlNode>(10);
     _node = Push(null, XmlNodeType.Document, null);
     _node.IsEmpty = false;
     _builder = new StringBuilder();
     _nameBuilder = new StringBuilder();
     _popToDepth = 0;
     _current = null;
     _partial = '\0';
     _endTag = null;
     _attr = null;
     _attrPosition = 0;
     _newNode = null;
     _rootCount = 0;
     _foundRoot = false;
     _unknownNamespaces.Clear();
 }
Пример #9
0
        //
        // Construction
        //

        private Processor(XPathNavigator doc, XsltArgumentList args, XmlResolver resolver, XslTransform transform) {
            transform.LoadCompiledStylesheet(out this.stylesheet, out this.queryList, out this.queryStore, out this.rootAction, doc);

            this.xsm                 = new StateMachine();
            this.document            = doc;
            this.builder             = null;
            this.actionStack         = new HWStack(StackIncrement, /*limit:*/1000);
            this.output              = this.rootAction.Output;
            this.resolver            = resolver != null ? resolver : new XmlUrlResolver();
            this.args                = args     != null ? args     : new XsltArgumentList();
            this.debugger            = transform.Debugger;
            if (this.debugger != null) {
                this.debuggerStack = new HWStack(StackIncrement, /*limit:*/1000);
                templateLookup     = new TemplateLookupActionDbg();
            }
            
            this.scriptExtensions = new Hashtable(this.stylesheet.ScriptObjectTypes.Count); {
                foreach(DictionaryEntry entry in this.stylesheet.ScriptObjectTypes) {
                    string namespaceUri = (string)entry.Key;
                    if (GetExtensionObject(namespaceUri) != null) {
	                    throw new XsltException(Res.Xslt_ScriptDub, namespaceUri);
                    }
                    scriptExtensions.Add(namespaceUri, Activator.CreateInstance((Type)entry.Value,
                        BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.CreateInstance, null, null, null));
                }
            }
            
            this.PushActionFrame(this.rootAction, /*nodeSet:*/null);
        }
Пример #10
0
        private void Init()
        {
            _validationStack = new HWStack(STACK_INCREMENT);
            _attPresence = new Hashtable();
            Push(XmlQualifiedName.Empty);

            _dummyPositionInfo = new PositionInfo(); //Dummy position info, will return (0,0) if user does not set the LineInfoProvider property
            _positionInfo = _dummyPositionInfo;
            _validationEventSender = this;
            _currentState = ValidatorState.None;
            _textValue = new StringBuilder(100);
            _xmlResolver = null;
            _contextQName = new XmlQualifiedName(); //Re-use qname
            Reset();

            RecompileSchemaSet(); //Gets compiled info from set as well
            //Get already Atomized strings
            _nsXs = _nameTable.Add(XmlReservedNs.NsXs);
            _nsXsi = _nameTable.Add(XmlReservedNs.NsXsi);
            _nsXmlNs = _nameTable.Add(XmlReservedNs.NsXmlNs);
            _nsXml = _nameTable.Add(XmlReservedNs.NsXml);
            _xsiTypeString = _nameTable.Add("type");
            _xsiNilString = _nameTable.Add("nil");
            _xsiSchemaLocationString = _nameTable.Add("schemaLocation");
            _xsiNoNamespaceSchemaLocationString = _nameTable.Add("noNamespaceSchemaLocation");
        }
 private void Init()
 {
     this.nsManager = base.reader.NamespaceManager;
     if (this.nsManager == null)
     {
         this.nsManager = new XmlNamespaceManager(base.NameTable);
         this.bManageNamespaces = true;
     }
     this.validationStack = new HWStack(10);
     base.textValue = new StringBuilder();
     this.attPresence = new Hashtable();
     base.schemaInfo = new SchemaInfo();
     base.checkDatatype = false;
     this.processContents = XmlSchemaContentProcessing.Strict;
     this.Push(XmlQualifiedName.Empty);
     this.NsXmlNs = base.NameTable.Add("http://www.w3.org/2000/xmlns/");
     this.NsXs = base.NameTable.Add("http://www.w3.org/2001/XMLSchema");
     this.NsXsi = base.NameTable.Add("http://www.w3.org/2001/XMLSchema-instance");
     this.XsiType = base.NameTable.Add("type");
     this.XsiNil = base.NameTable.Add("nil");
     this.XsiSchemaLocation = base.NameTable.Add("schemaLocation");
     this.XsiNoNamespaceSchemaLocation = base.NameTable.Add("noNamespaceSchemaLocation");
     this.XsdSchema = base.NameTable.Add("schema");
 }
Пример #12
0
       // protected constructor, users should not be using this
        /// <include file='doc\XmlTextReader.uex' path='docs/doc[@for="XmlTextReader.XmlTextReader1"]/*' />
        /// <internalonly/>
        /// <devdoc>
        ///    <para>Initializes a new instance of the XmlTextReader class with the specified XmlNameTable.</para>
        /// </devdoc>
        protected XmlTextReader( XmlNameTable nt ) {
            //
            // internal variables
            //
            _ElementDepth = -1;
            _EntityDepthOffset = 0;
            _ReadCount = -1;

            //
            // variables for properties
            //
            _ReadState = ReadState.Initial;
            _NextState = 1;

            //
            // create interal components
            //
            _NameTable = nt;
            _ElementStack = new HWStack(STACK_INCREMENT);
            _ScannerStack = new HWStack(STACK_INCREMENT);

            //
            //create atom
            //
            _StringName                 = _NameTable.Add("String");
            _MicrosoftSystemNamespace   = _NameTable.Add("System");
            _Decimal                    = _NameTable.Add("#decimal");
            _Hex                        = _NameTable.Add("#hexidecimal");
            _Amp                        = _NameTable.Add("amp");
            _Lt                         = _NameTable.Add("lt");
            _Gt                         = _NameTable.Add("gt");
            _Quot                       = _NameTable.Add("quot");
            _Apos                       = _NameTable.Add("apos");
            _XmlNs                      = _NameTable.Add("xmlns");
            _XmlSpaceAtom               = _NameTable.Add("xml:space");
            _XmlLangAtom                = _NameTable.Add("xml:lang");

            //
            //fields collection
            //
            _Used = -1;
            _MarkScannerCount = 10000;

            //
            _XmlSpace = XmlSpace.None;
            _XmlLang = String.Empty;
            _WhitespaceHandling = WhitespaceHandling.All;

            _XmlResolver = new XmlUrlResolver();
            _CheckNamespaces = true;

            _TmpToken  = new XmlNSElementTokenInfo(_Scanner, _NsMgr, XmlNodeType.None, String.Empty,-1, -1, -1, 0,false);
            _CurrentToken = _TmpToken;

            // PERF: these node types are not common therefore they
            // will only be constructed when used
            //
            _CommentToken = null;
            _CDATAToken = null;
            _DocTypeToken = null;
            _PIToken = null;
            _EndEntityToken = null;

            _NextFunction = _InitReader;

            _StringBuilder = new StringBuilder(100);
        }
Пример #13
0
 internal XsdBuilder( 
                    XmlReader reader,
                    XmlNamespaceManager curmgr, 
                    XmlSchema schema, 
                    XmlNameTable nameTable,
                    SchemaNames schemaNames,
                    ValidationEventHandler eventhandler
                    ) {
     this.reader = reader;
     this.xso = this.schema = schema;
     this.namespaceManager = curmgr;
     this.validationEventHandler = eventhandler;
     this.nameTable = nameTable;
     this.schemaNames = schemaNames;
     this.stateHistory = new HWStack(STACK_INCREMENT);
     this.currentEntry = SchemaEntries[0];
     positionInfo = PositionInfo.GetPositionInfo(reader);
 }
Пример #14
0
 internal XsdBuilder(
                    XmlReader reader,
                    XmlNamespaceManager curmgr,
                    XmlSchema schema,
                    XmlNameTable nameTable,
                    SchemaNames schemaNames,
                    ValidationEventHandler eventhandler
                    )
 {
     _reader = reader;
     _xso = _schema = schema;
     _namespaceManager = new BuilderNamespaceManager(curmgr, reader);
     _validationEventHandler = eventhandler;
     _nameTable = nameTable;
     _schemaNames = schemaNames;
     _stateHistory = new HWStack(STACK_INCREMENT);
     _currentEntry = s_schemaEntries[0];
     _positionInfo = PositionInfo.GetPositionInfo(reader);
 }
 private void Init()
 {
     this.nsManager = base.reader.NamespaceManager;
     if (this.nsManager == null)
     {
         this.nsManager = new XmlNamespaceManager(base.NameTable);
         this.isProcessContents = true;
     }
     this.validationStack = new HWStack(10);
     base.textValue = new StringBuilder();
     this.name = XmlQualifiedName.Empty;
     this.attPresence = new Hashtable();
     this.Push(XmlQualifiedName.Empty);
     base.schemaInfo = new SchemaInfo();
     base.checkDatatype = false;
 }
Пример #16
0
 public SgmlNode()
 {
     _attributes = new HWStack<Attribute>(10);
 }