mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
* Parser.jay : now it supresses error output from jay. * DefaultContext.cs : (XPathFunctionSubstring) exclude -Infinity. * Tokenizer.cs : better error message. * XPathDocument.cs : Use XmlValidatingReader to support id() function. (just found MS.NET actually supports it) svn path=/trunk/mcs/; revision=21310
84 lines
1.6 KiB
C#
84 lines
1.6 KiB
C#
//
|
|
// System.Xml.XPath.XPathDocument
|
|
//
|
|
// Authors:
|
|
// Tim Coleman ([email protected])
|
|
// Atsushi Enomoto ([email protected])
|
|
//
|
|
// (C) Copyright 2002 Tim Coleman
|
|
// (C) 2003 Atsushi Enomoto
|
|
//
|
|
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using System.Xml;
|
|
using System.Xml.Schema;
|
|
using Mono.Xml.XPath;
|
|
|
|
namespace System.Xml.XPath
|
|
{
|
|
|
|
public class XPathDocument : IXPathNavigable
|
|
{
|
|
DTMXPathDocument document;
|
|
|
|
#region Constructors
|
|
|
|
public XPathDocument (Stream stream)
|
|
{
|
|
XmlValidatingReader vr = new XmlValidatingReader (new XmlTextReader (stream));
|
|
vr.ValidationType = ValidationType.None;
|
|
Initialize (vr, XmlSpace.None);
|
|
}
|
|
|
|
public XPathDocument (string uri)
|
|
: this (uri, XmlSpace.None)
|
|
{
|
|
}
|
|
|
|
public XPathDocument (TextReader reader)
|
|
{
|
|
XmlValidatingReader vr = new XmlValidatingReader (new XmlTextReader (reader));
|
|
vr.ValidationType = ValidationType.None;
|
|
Initialize (vr, XmlSpace.None);
|
|
}
|
|
|
|
public XPathDocument (XmlReader reader)
|
|
: this (reader, XmlSpace.None)
|
|
{
|
|
}
|
|
|
|
public XPathDocument (string uri, XmlSpace space)
|
|
{
|
|
XmlValidatingReader vr = new XmlValidatingReader (new XmlTextReader (uri));
|
|
vr.ValidationType = ValidationType.None;
|
|
Initialize (vr, space);
|
|
}
|
|
|
|
public XPathDocument (XmlReader reader, XmlSpace space)
|
|
{
|
|
Initialize (reader, space);
|
|
}
|
|
|
|
private void Initialize (XmlReader reader, XmlSpace space)
|
|
{
|
|
document = new DTMXPathDocumentBuilder (reader, space).CreateDocument ();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Methods
|
|
|
|
public XPathNavigator CreateNavigator ()
|
|
{
|
|
return document.CreateNavigator ();
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|