Esempio n. 1
1
 /// <include file='doc\XmlParserContext.uex' path='docs/doc[@for="XmlParserContext.XmlParserContext3"]/*' />
 public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, String docTypeName,
                   String pubId, String sysId, String internalSubset, String baseURI,
                   String xmlLang, XmlSpace xmlSpace, Encoding enc)
 {
     
     if (nsMgr != null) {
         if (nt == null) {
             _nt = nsMgr.NameTable;
         }
         else {
             if ( (object)nt != (object)  nsMgr.NameTable ) {
                 throw new XmlException(Res.Xml_NotSameNametable);
             }
             _nt = nt;
         }
     }
     else {
         _nt = nt;
     }
     
     _nsMgr              = nsMgr;
     _docTypeName        = (null == docTypeName ? String.Empty : docTypeName);
     _pubId              = (null == pubId ? String.Empty : pubId);
     _sysId              = (null == sysId ? String.Empty : sysId);
     _internalSubset     = (null == internalSubset ? String.Empty : internalSubset);
     _baseURI            = (null == baseURI ? String.Empty : baseURI);
     _xmlLang            = (null == xmlLang ? String.Empty : xmlLang);
     _xmlSpace           = xmlSpace;
     _encoding           = enc;
     
 }
Esempio n. 2
0
 internal XPathDocument() {
     this.space = XmlSpace.Default;
     this.root = new XPathRoot();
     this.root.topNamespace = new XPathNamespace( "xml", "http://www.w3.org/XML/1998/namespace", ++ documentIndex );
     this.nt = new NameTable();
     this.baseURI = string.Empty;
 }
Esempio n. 3
0
        internal XmlParserContext(XmlNameTable nt,
                                  XmlNamespaceManager nsMgr,
                                  DTDObjectModel dtd,
                                  string baseURI,
                                  string xmlLang,
                                  XmlSpace xmlSpace,
                                  Encoding enc)
        {
            this.namespaceManager = nsMgr;
            this.nameTable        = nt != null ? nt : nsMgr != null ? nsMgr.NameTable : null;
            if (dtd != null)
            {
                this.DocTypeName    = dtd.Name;
                this.PublicId       = dtd.PublicId;
                this.SystemId       = dtd.SystemId;
                this.InternalSubset = dtd.InternalSubset;
                this.dtd            = dtd;
            }
            this.encoding = enc;

            this.BaseURI  = baseURI;
            this.XmlLang  = xmlLang;
            this.xmlSpace = xmlSpace;

            contextItems = new ArrayList();
        }
Esempio n. 4
0
        public override void WriteEndElement()
        {
            if (element_count-- == 0)
            {
                throw new InvalidOperationException("There was no XML start tag open.");
            }

            if (state == WriteState.Attribute)
            {
                WriteEndAttribute();
            }

            // Comment+EndElement does not exist
            bool needExplicitEndElement = buffer.Position == 0 || !SupportsCombinedEndElementSupport(buffer.GetBuffer() [0]);

            ProcessPendingBuffer(true, !needExplicitEndElement);
            CheckState();
            AddMissingElementXmlns();

            if (needExplicitEndElement)
            {
                writer.Write(BF.EndElement);
            }

            element_ns = element_ns_stack.Pop();
            xml_lang   = xml_lang_stack.Pop();
            xml_space  = xml_space_stack.Pop();
            int cur = namespaces.Count;

            ns_index = ns_index_stack.Pop();
            namespaces.RemoveRange(ns_index, cur - ns_index);
            open_start_element = false;

            Depth--;
        }
 internal XmlEntityReader(XmlScanner scanner, XmlNameTable nt, XmlNamespaceManager nsMgr, XmlNodeType node, String entityName, int depth, Encoding encoding, String baseURI,
                          bool isExternal, bool isAttributeText, bool standAlone, String originalBaseURI) :
     base((scanner == null ? new XmlScanner(new StringReader("a"), nt) : scanner), nt, nsMgr, node, depth, encoding, baseURI, isExternal, standAlone)
 {
     if (scanner == null)
     {
         _IsScanner                = false;
         _AttributeTextToken       = new XmlNSAttributeTokenInfo(_Scanner, _NsMgr, XmlNodeType.Text, Normalization, _XmlNs);
         _AttributeTextToken.Value = String.Empty;
         _AttributeTextToken.Depth = depth + 1;
     }
     else
     {
         _IsScanner = true;
     }
     _IsExternal = isExternal;
     //We only need to return the EndEntity token when EntityHandling = ExpandCharEntity
     _EndEntityToken      = new XmlNameValueTokenInfo(_Scanner, _NsMgr, XmlNodeType.EndEntity, depth - 1, String.Empty, false);
     _EndEntityToken.Name = entityName;
     _EndEntityEncoding   = encoding;
     _IsAttributeText     = isAttributeText;
     _PrevXmlSpace        = XmlSpace.None;
     _PrevXmlLang         = String.Empty;
     _OriginalBaseUri     = originalBaseURI;
 }
Esempio n. 6
0
 public XmlParserContext(XmlNameTable?nt, XmlNamespaceManager?nsMgr, string?docTypeName,
                         string?pubId, string?sysId, string?internalSubset, string?baseURI,
                         string?xmlLang, XmlSpace xmlSpace)
     : this(nt, nsMgr, docTypeName, pubId, sysId, internalSubset, baseURI, xmlLang, xmlSpace, null)
 {
     // Intentionally Empty
 }
Esempio n. 7
0
 /// <include file='doc\XmlParserContext.uex' path='docs/doc[@for="XmlParserContext.XmlParserContext1"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr, String docTypeName,
           String pubId, String sysId, String internalSubset, String baseURI,
           String xmlLang, XmlSpace xmlSpace) 
 : this(nt, nsMgr, docTypeName, pubId, sysId, internalSubset, baseURI, xmlLang, xmlSpace, null)
 {
     // Intentionally Empty
 }
Esempio n. 8
0
        public XPathNavigator CreateNavigator(int nodeQuota, XmlSpace space)
        {
            if (nodeQuota <= 0)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nodeQuota", SR.GetString(SR.FilterQuotaRange)));

            return new SeekableMessageNavigator(this.CreateMessage(), nodeQuota, space, true, true);
        }
Esempio n. 9
0
 internal XmlContext()
 {
     xmlSpace         = XmlSpace.None;
     xmlLang          = string.Empty;
     defaultNamespace = string.Empty;
     previousContext  = null;
 }
Esempio n. 10
0
        /// <summary>
        /// Create a new document from "reader", with whitespace handling controlled according to "space".
        /// </summary>
        public XPathDocument(XmlReader reader, XmlSpace space)
        {
            if (reader == null)
                throw new ArgumentNullException(nameof(reader));

            LoadFromReader(reader, space);
        }
Esempio n. 11
0
        private XPathNavigator GetXPathDocumentNavigator(XmlNode node, XmlSpace space)
        {
            XmlNodeReader xr = new XmlNodeReader(node);

            xpathDocument = new XPathDocument(xr, space);
            return(xpathDocument.CreateNavigator());
        }
Esempio n. 12
0
        public XmlParserContext(XmlNameTable?nt, XmlNamespaceManager?nsMgr, string?docTypeName,
                                string?pubId, string?sysId, string?internalSubset, string?baseURI,
                                string?xmlLang, XmlSpace xmlSpace, Encoding?enc)
        {
            if (nsMgr != null)
            {
                if (nt == null)
                {
                    _nt = nsMgr.NameTable;
                }
                else
                {
                    if ((object)nt != (object?)nsMgr.NameTable)
                    {
                        throw new XmlException(SR.Xml_NotSameNametable, string.Empty);
                    }

                    _nt = nt;
                }
            }
            else
            {
                _nt = nt;
            }

            _nsMgr          = nsMgr;
            _docTypeName    = (null == docTypeName ? string.Empty : docTypeName);
            _pubId          = (null == pubId ? string.Empty : pubId);
            _sysId          = (null == sysId ? string.Empty : sysId);
            _internalSubset = (null == internalSubset ? string.Empty : internalSubset);
            _baseURI        = (null == baseURI ? string.Empty : baseURI);
            _xmlLang        = (null == xmlLang ? string.Empty : xmlLang);
            _xmlSpace       = xmlSpace;
            _encoding       = enc;
        }
Esempio n. 13
0
 private void AddSpaceControls(XmlQualifiedName[] names, XmlSpace result, XPathNavigator styleElem)
 {
     foreach (XmlQualifiedName key in names)
     {
         this.spaceControls[key] = result;
     }
 }
Esempio n. 14
0
        public XmlParserContext(
            XmlNameTable nt,
            XmlNamespaceManager nsMgr,
            string docTypeName,
            string pubId,
            string sysId,
            string internalSubset,
            string baseURI,
            string xmlLang,
            XmlSpace xmlSpace) :

            this(
                nt,
                nsMgr,
                docTypeName,
                pubId,
                sysId,
                internalSubset,
                baseURI,
                xmlLang,
                xmlSpace,
                null
                )
        {
        }
Esempio n. 15
0
 internal XmlContext(XmlContext previousContext)
 {
     this.xmlSpace         = previousContext.xmlSpace;
     this.xmlLang          = previousContext.xmlLang;
     this.defaultNamespace = previousContext.defaultNamespace;
     this.previousContext  = previousContext;
 }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the XPathDocument class from the XML data in the file specified with the white space handling specified.
 /// </summary>
 /// <param name="uri">The path of the file that contains the XML data.</param>
 /// <param name="space">An XmlSpace object.</param>
 /// <returns>A new instance of the XPathDocument class.</returns>
 public static XPathDocument CreateXPathDocument(string uri, XmlSpace space)
 {
     using (XmlReader xr = XmlReader.Create(uri, SafeXmlFactory.defaultSettings))
     {
         return(CreateXPathDocument(xr, space));
     }
 }
Esempio n. 17
0
 private void AddSpaceControls(QName [] names, XmlSpace result, XPathNavigator styleElem)
 {
     // XSLT 3.4 - This implementation recovers from errors.
     foreach (QName name in names)
     {
         spaceControls [name] = result;
     }
 }
Esempio n. 18
0
 public XPathDocument(XmlReader reader, XmlSpace space)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     this.LoadFromReader(reader, space);
 }
 public XPathDocument(XmlReader reader, XmlSpace space)
 {
     if (reader == null)
     {
         throw new ArgumentNullException("reader");
     }
     this.LoadFromReader(reader, space);
 }
Esempio n. 20
0
 // Constructors.
 public XmlParserContext
     (XmlNameTable nt,
     XmlNamespaceManager nsMgr,
     String xmlLang,
     XmlSpace xmlSpace)
     : this(nt, nsMgr, null, null, null, null, "", xmlLang, xmlSpace, null)
 {
 }
Esempio n. 21
0
 public XPathNavigator CreateNavigator(int nodeQuota, XmlSpace space)
 {
     if (nodeQuota <= 0)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("nodeQuota", System.ServiceModel.SR.GetString("FilterQuotaRange")));
     }
     return(new SeekableMessageNavigator(this.CreateMessage(), nodeQuota, space, true, true));
 }
 internal void Set(string prefix, string localName, string namespaceUri, int prevNSTop) {
     this.prevNSTop = prevNSTop;
     this.prefix = prefix;
     this.namespaceUri = namespaceUri;
     this.localName = localName;
     this.xmlSpace = (System.Xml.XmlSpace)(int)-1;
     this.xmlLang = null;
 }
Esempio n. 23
0
 public static XPathDocument CreateXPathDocument(XmlReader reader, XmlSpace space)
 {
     if (reader.Settings != null && reader.Settings.DtdProcessing != DtdProcessing.Prohibit)
     {
         throw new XmlDtdException();
     }
     return(new XPathDocument(reader, space));
 }
	// Constructors.
	public XmlParserContext
				(XmlNameTable nt,
				 XmlNamespaceManager nsMgr,
				 String xmlLang,
				 XmlSpace xmlSpace)
			: this(nt, nsMgr, null, null, null, null, "", xmlLang, xmlSpace, null)
			{
			}
Esempio n. 25
0
 internal XmlElementReference(XmlContainerReference parent, SourceContext sourceContext, SourceContext startTagContext, bool beginTracking)
     : base(parent, parent.TextBuffer, sourceContext, beginTracking)
 {
     if (beginTracking && startTagContext.EndCol > startTagContext.StartCol)
     {
         this.startTagRange = XamlSourceContext.ToTextRange(this.TextBuffer, startTagContext);
     }
     this.xmlSpace = parent.XmlSpace;
 }
Esempio n. 26
0
        /// <summary>
        /// Create a new document from "reader", with whitespace handling controlled according to "space".
        /// </summary>
        public XPathDocument(XmlReader reader, XmlSpace space)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            LoadFromReader(reader, space);
        }
Esempio n. 27
0
 internal void Set(string prefix, string localName, string namespaceUri, int prevNSTop)
 {
     this.prevNSTop    = prevNSTop;
     this.prefix       = prefix;
     this.namespaceUri = namespaceUri;
     this.localName    = localName;
     this.xmlSpace     = (System.Xml.XmlSpace)(int) - 1;
     this.xmlLang      = null;
 }
Esempio n. 28
0
 /// <summary>
 ///     Attribute objects are reused during parsing to reduce memory allocations,
 ///     hence the Reset method.
 /// </summary>
 public void Reset(string name, XmlNodeType nt, string value) {
     this.Value = value;
     this.Name = name;
     this.NodeType = nt;
     this.Space = XmlSpace.None;
     this.XmlLang = null;
     this.IsEmpty = true;
     this.attributes.Count = 0;
     this.DtdType = null;
 }
Esempio n. 29
0
            internal bool mixed; // whether to pretty print the contents of this element.

            internal void Init( int nsTop ) {
                name = null;
                defaultNs = String.Empty;
                defaultNsState = NamespaceState.Uninitialized;
                xmlSpace = XmlSpace.None;
                xmlLang = null;
                prevNsTop = nsTop;
                prefixCount = 0;
                mixed = false;
            }
Esempio n. 30
0
		public XPathNavigator CreateNavigator (int node_quota, XmlSpace space)
		{
			if (nav_cache == null) {
				DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2 (new NameTable (), node_quota);
				XmlDictionaryWriter w = XmlDictionaryWriter.CreateDictionaryWriter (pw);
				CreateMessage ().WriteMessage (w);
				nav_cache = pw.CreateDocument ().CreateNavigator ();
			}
			return nav_cache.Clone ();
		}
Esempio n. 31
0
        public static XPathDocument CreateXPathDocument(string uri, XmlSpace space)
        {
            XPathDocument result;

            using (XmlReader xmlReader = XmlReader.Create(uri, SafeXmlFactory.defaultSettings))
            {
                result = SafeXmlFactory.CreateXPathDocument(xmlReader, space);
            }
            return(result);
        }
		public DTMXPathDocumentBuilder2 (string url, XmlSpace space, int defaultCapacity)
		{
			XmlReader r = null;
			try {
				r = new XmlTextReader (url);
				Init (r, space, defaultCapacity);
			} finally {
				if (r != null)
					r.Close ();
			}
		}
Esempio n. 33
0
 internal void Init(string name, string nspace, string prefix, XmlSpace space, string lang, bool mixed) {
     this.scopes           = null;
     this.name             = name;
     this.nsUri            = nspace;
     this.prefix           = prefix;
     this.space            = space;
     this.lang             = lang;
     this.mixed            = mixed;
     this.toCData          = false;
     this.htmlElementProps = null;
 }
Esempio n. 34
0
        /// <summary>
        /// Create a new document and load the content from the Uri, with whitespace handling controlled according to "space".
        /// </summary>
        public XPathDocument(string uri, XmlSpace space)
        {
            XmlTextReaderImpl reader = SetupReader(new XmlTextReaderImpl(uri));

            try {
                LoadFromReader(reader, space);
            }
            finally {
                reader.Close();
            }
        }
Esempio n. 35
0
 /// <summary>
 ///     Attribute objects are reused during parsing to reduce memory allocations,
 ///     hence the Reset method.
 /// </summary>
 public void Reset(string name, XmlNodeType nt, string value)
 {
     this.Value            = value;
     this.Name             = name;
     this.NodeType         = nt;
     this.Space            = XmlSpace.None;
     this.XmlLang          = null;
     this.IsEmpty          = true;
     this.attributes.Count = 0;
     this.DtdType          = null;
 }
Esempio n. 36
0
 /// <summary>
 /// Attribute objects are reused during parsing to reduce memory allocations,
 /// hence the Reset method.
 /// </summary>
 public void Reset(string name, XmlNodeType nt, string value)
 {
     _value            = value;
     _name             = name;
     _nodeType         = nt;
     _space            = XmlSpace.None;
     _xmlLang          = null;
     _isEmpty          = true;
     _attributes.Count = 0;
     _dtdType          = null;
 }
Esempio n. 37
0
 public override bool Read() {
     if (_IsScanner && base.Read()) {
         _PrevXmlLang = _XmlLang;
         _PrevXmlSpace = _XmlSpace;
         _PrevLineNum = this.LineNumber;
         _PrevLinePos = this.LinePosition;
         return true;
     } else {
         return ProduceExtraNodes();
     }
 }
Esempio n. 38
0
 /// <summary>
 /// Attribute objects are reused during parsing to reduce memory allocations,
 /// hence the Reset method.
 /// </summary>
 public void Reset(string name, XmlNodeType nt, string value)
 {
     Value             = value;
     Name              = name;
     NodeType          = nt;
     Space             = XmlSpace.None;
     XmlLang           = null;
     IsEmpty           = true;
     _attributes.Count = 0;
     DtdType           = null;
 }
Esempio n. 39
0
 public XPathNavigator CreateNavigator(int nodeQuota, XmlSpace space)
 {
     if (nav_cache == null)
     {
         DTMXPathDocumentWriter2 pw = new DTMXPathDocumentWriter2(new NameTable(), nodeQuota);
         XmlDictionaryWriter     w  = XmlDictionaryWriter.CreateDictionaryWriter(pw);
         CreateMessage().WriteMessage(w);
         nav_cache = pw.CreateDocument().CreateNavigator();
     }
     return(nav_cache.Clone());
 }
Esempio n. 40
0
 public void method_0(string A_0, XmlNodeType A_1, string A_2)
 {
     this.string_0      = A_2;
     this.string_2      = A_0;
     this.xmlNodeType_0 = A_1;
     this.xmlSpace_0    = XmlSpace.None;
     this.string_1      = null;
     this.bool_0        = true;
     this.class830_0.method_1(0);
     this.class636_0 = null;
 }
Esempio n. 41
0
 internal void PopScope()
 {
     if (this.contextItemCount == 0)
     {
         throw new XmlException("Unexpected end of element scope.");
     }
     this.contextItemCount--;
     XmlParserContext.ContextItem contextItem = (XmlParserContext.ContextItem) this.contextItems[this.contextItemCount];
     this.baseURI  = contextItem.BaseURI;
     this.xmlLang  = contextItem.XmlLang;
     this.xmlSpace = contextItem.XmlSpace;
 }
Esempio n. 42
0
 internal void Init(string name, string nspace, string prefix, XmlSpace space, string lang, bool mixed)
 {
     this.scopes           = null;
     this.name             = name;
     this.nsUri            = nspace;
     this.prefix           = prefix;
     this.space            = space;
     this.lang             = lang;
     this.mixed            = mixed;
     this.toCData          = false;
     this.htmlElementProps = null;
 }
Esempio n. 43
0
 internal void Init(string name, string nspace, string prefix, XmlSpace space, string lang, bool mixed)
 {
     this.scopes = null;
     _name = name;
     _nsUri = nspace;
     _prefix = prefix;
     _space = space;
     _lang = lang;
     _mixed = mixed;
     _toCData = false;
     _htmlElementProps = null;
 }
Esempio n. 44
0
 internal void Init(string name, string nspace, string prefix, XmlSpace space, string lang, bool mixed)
 {
     this.scopes       = null;
     _name             = name;
     _nsUri            = nspace;
     _prefix           = prefix;
     _space            = space;
     _lang             = lang;
     _mixed            = mixed;
     _toCData          = false;
     _htmlElementProps = null;
 }
Esempio n. 45
0
 private bool HasStripSpace(IDictionary table)
 {
     foreach (object obj in table.Values)
     {
         XmlSpace xmlSpace = (XmlSpace)((int)obj);
         if (xmlSpace == XmlSpace.Default)
         {
             return(true);
         }
     }
     return(false);
 }
 public XPathDocument(string uri, XmlSpace space)
 {
     XmlTextReaderImpl reader = this.SetupReader(new XmlTextReaderImpl(uri));
     try
     {
         this.LoadFromReader(reader, space);
     }
     finally
     {
         reader.Close();
     }
 }
Esempio n. 47
0
		public XPathDocument (string uri, XmlSpace space)
		{
			XmlValidatingReader vr = null;
			try {
				vr = new XmlValidatingReader (new XmlTextReader (uri));
				vr.ValidationType = ValidationType.None;
				Initialize (vr, space);
			} finally {
				if (vr != null)
					vr.Close ();
			}
		}
Esempio n. 48
0
        internal override bool ReadAttributeValue(EntityHandling ehMode) {
            if ( this.PartialContentNodeType == XmlNodeType.Attribute) {
                return Read();
            }

            if(!_IsScanner) {
                return ProduceExtraNodes();
            }

            if (base.ReadAttributeValue(ehMode)) {
                _PrevXmlLang = _XmlLang;
                _PrevXmlSpace = _XmlSpace;
                return true;
            }

            return false;
        }
Esempio n. 49
0
		private void Init (XmlReader reader, XmlSpace space, int defaultCapacity)
		{
			this.xmlReader = reader;
			this.validatingReader = reader as XmlValidatingReader;
			lineInfo = reader as IXmlLineInfo;
			this.xmlSpace = space;
			this.nameTable = reader.NameTable;
			nodeCapacity = defaultCapacity;
			attributeCapacity = nodeCapacity;
			idTable = new Hashtable ();

			nodes = new DTMXPathLinkedNode [nodeCapacity];
			attributes = new DTMXPathAttributeNode [attributeCapacity];
			namespaces = new DTMXPathNamespaceNode [0];

			Compile ();
		}
	public XmlParserContext
				(XmlNameTable nt,
				 XmlNamespaceManager nsMgr,
				 String docTypeName,
				 String pubId,
				 String sysId,
				 String internalSubset,
				 String baseURI,
				 String xmlLang,
				 XmlSpace xmlSpace,
				 Encoding enc)
			{
				// set up the name table and namespace manager
				if(nsMgr != null && nt != null && nsMgr.NameTable != nt)
				{
					throw new XmlException(S._("Xml_WrongNameTable"));
				}
				else if(nt == null)
				{
					if(nsMgr == null)
					{
						nsMgr = new XmlNamespaceManager(new NameTable());
					}
					nametable = nsMgr.NameTable;
				}
				else
				{
					nametable = nt;
				}
				namespacemanager = nsMgr;

				// set various properties
				doctypename = (docTypeName == null) ? "" : docTypeName;
				publicid = (pubId == null) ? "" : pubId;
				systemid = (sysId == null) ? "" : sysId;
				internalsubset = (internalSubset == null) ? "" : internalSubset;
				encoding = enc;

				// set up scoped values
				baseURI = (baseURI == null) ? "" : baseURI;
				xmlLang = (xmlLang == null) ? "" : xmlLang;
				stackmanager = new StackManager(baseURI, xmlLang, xmlSpace);
			}
Esempio n. 51
0
		public XmlParserContext (
			XmlNameTable nt,
			XmlNamespaceManager nsMgr,
			string xmlLang,
			XmlSpace xmlSpace,
			Encoding enc) :

			this (
				nt,
				nsMgr,
				null,
				null,
				null,
				null,
				null,
				xmlLang,
				xmlSpace,
				enc
			)
		{
		}
Esempio n. 52
0
 internal XmlEntityReader(XmlScanner scanner, XmlNameTable nt, XmlNamespaceManager nsMgr, XmlNodeType node, String entityName, int depth, Encoding encoding, String baseURI,
                         bool isExternal, bool isAttributeText, bool standAlone, String originalBaseURI) :
                         base((scanner == null ? new XmlScanner(new StringReader("a"), nt) : scanner), nt, nsMgr, node, depth, encoding, baseURI, isExternal, standAlone) {
     if (scanner == null) {
         _IsScanner = false;
         _AttributeTextToken = new XmlNSAttributeTokenInfo(_Scanner, _NsMgr, XmlNodeType.Text, Normalization, _XmlNs);
         _AttributeTextToken.Value = String.Empty;
         _AttributeTextToken.Depth = depth + 1;
     }
     else {
         _IsScanner = true;
     }
     _IsExternal = isExternal;
     //We only need to return the EndEntity token when EntityHandling = ExpandCharEntity
     _EndEntityToken = new XmlNameValueTokenInfo(_Scanner, _NsMgr, XmlNodeType.EndEntity, depth-1, String.Empty, false);
     _EndEntityToken.Name = entityName;
     _EndEntityEncoding = encoding;
     _IsAttributeText = isAttributeText;
     _PrevXmlSpace = XmlSpace.None;
     _PrevXmlLang = String.Empty;
     _OriginalBaseUri = originalBaseURI;
 }
        public static ArrayList ExtractFromAlchemyKeywordXML(Stream xmlStream)
        {
            XmlReader r = XmlReader.Create(xmlStream);
            XmlSpace sp = new XmlSpace();

            XPathDocument doc = new XPathDocument(r);
            XPathNavigator nav = doc.CreateNavigator();

            //XmlNamespaceManager manager = new XmlNamespaceManager(nav.NameTable);
            //manager.AddNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
            //manager.AddNamespace("aapi", "http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#");
            //manager.AddNamespace("owl", "http://www.w3.org/2002/07/owl#");
            //manager.AddNamespace("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#");
            //manager.AddNamespace("base", "http://rdf.alchemyapi.com/rdf/v1/r/response.rdf");

            //XPathNodeIterator iter = nav.Select("//rdf:Description[contains(@rdf:ID,'-gk_')]/aapi:Name", manager);
            XPathNodeIterator iter = nav.Select("//keyword/text");

            ArrayList keywords = new ArrayList();
            while (iter.MoveNext())
                keywords.Add(iter.Current.Value);

            return keywords;
        }
Esempio n. 54
0
 /// <include file='doc\XmlParserContext.uex' path='docs/doc[@for="XmlParserContext.XmlParserContext2"]/*' />
 public XmlParserContext(XmlNameTable nt, XmlNamespaceManager nsMgr,String xmlLang, XmlSpace xmlSpace, Encoding enc)
 : this(nt, nsMgr, null, null, null, null, String.Empty, xmlLang, xmlSpace, enc)
 {
     // Intentionally Empty
 }
Esempio n. 55
0
 public void AddSpaceAttribute(XmlSpace space)
 {
     AddAttribute();
     _space = space;
 }
Esempio n. 56
0
 public void ExitScope()
 {
     while (_nsCount > 0)
     {
         Namespace nameSpace = _namespaces[_nsCount - 1];
         if (nameSpace.Depth != _depth)
             break;
         PrefixHandleType shortPrefix;
         if (nameSpace.Prefix.TryGetShortPrefix(out shortPrefix))
         {
             _shortPrefixUri[(int)shortPrefix] = nameSpace.OuterUri;
         }
         _nsCount--;
     }
     while (_attributeCount > 0)
     {
         XmlAttribute attribute = _attributes[_attributeCount - 1];
         if (attribute.Depth != _depth)
             break;
         _space = attribute.XmlSpace;
         _lang = attribute.XmlLang;
         _attributeCount--;
     }
     _depth--;
 }
Esempio n. 57
0
 public void Clear()
 {
     if (_nsCount != 0)
     {
         if (_shortPrefixUri != null)
         {
             for (int i = 0; i < _shortPrefixUri.Length; i++)
             {
                 _shortPrefixUri[i] = null;
             }
         }
         _shortPrefixUri[(int)PrefixHandleType.Empty] = s_emptyNamespace;
         _nsCount = 0;
     }
     _attributeCount = 0;
     _space = XmlSpace.None;
     _lang = string.Empty;
     _depth = 0;
 }
Esempio n. 58
0
 public NamespaceManager(XmlBufferReader bufferReader)
 {
     _bufferReader = bufferReader;
     _shortPrefixUri = new Namespace[(int)PrefixHandleType.Max];
     _shortPrefixUri[(int)PrefixHandleType.Empty] = s_emptyNamespace;
     _namespaces = null;
     _nsCount = 0;
     _attributes = null;
     _attributeCount = 0;
     _space = XmlSpace.None;
     _lang = string.Empty;
     _depth = 0;
 }
		private void AddSpaceControls (QName [] names, XmlSpace result,	XPathNavigator styleElem)
		{
			// XSLT 3.4 - This implementation recovers from errors.
			foreach (QName name in names)
				spaceControls [name] = result;
		}
Esempio n. 60
0
		private XPathNavigator GetXPathDocumentNavigator (XmlNode node, XmlSpace space)
		{
			XmlNodeReader xr = new XmlNodeReader (node);
			xpathDocument = new XPathDocument (xr, space);
			return xpathDocument.CreateNavigator ();
		}