Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,67 @@
//
// Mono.Xml.XPath.DTMXPathDocument
//
// Author:
// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
//
// (C) 2003 Atsushi Enomoto
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Xml;
using System.Xml.XPath;
namespace Mono.Xml.XPath
{
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
class DTMXPathDocument : IXPathNavigable
{
public DTMXPathDocument (XmlNameTable nameTable,
DTMXPathLinkedNode [] nodes,
DTMXPathAttributeNode [] attributes,
DTMXPathNamespaceNode [] namespaces,
Hashtable idTable)
{
root = new DTMXPathNavigator (this,
nameTable,
nodes,
attributes,
namespaces,
idTable);
}
public XPathNavigator CreateNavigator ()
{
return root.Clone ();
}
XPathNavigator root;
}
}

View File

@@ -0,0 +1,85 @@
//
// Mono.Xml.XPath.DTMXPathDocument2
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// (C) 2004 Novell Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.Xml;
using System.Xml.XPath;
namespace Mono.Xml.XPath
{
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
class DTMXPathDocument2 : IXPathNavigable
{
public DTMXPathDocument2 (XmlNameTable nameTable,
DTMXPathLinkedNode2 [] nodes,
DTMXPathAttributeNode2 [] attributes,
DTMXPathNamespaceNode2 [] namespaces,
string [] atomicStringPool,
string [] nonAtomicStringPool,
Hashtable idTable)
{
this.Nodes = nodes;
this.Attributes = attributes;
this.Namespaces = namespaces;
this.AtomicStringPool = atomicStringPool;
this.NonAtomicStringPool = nonAtomicStringPool;
this.IdTable = idTable;
this.NameTable = nameTable;
root = new DTMXPathNavigator2 (this);
}
public XPathNavigator CreateNavigator ()
{
return root.Clone ();
}
readonly XPathNavigator root;
internal readonly XmlNameTable NameTable;
internal readonly DTMXPathLinkedNode2 [] Nodes;
internal readonly DTMXPathAttributeNode2 [] Attributes;
internal readonly DTMXPathNamespaceNode2 [] Namespaces;
// String pool
internal readonly string [] AtomicStringPool;
internal readonly string [] NonAtomicStringPool;
// ID table
internal readonly Hashtable IdTable;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,105 @@
//
// Mono.Xml.XPath.DTMXPathNode.cs
//
// Author:
// Atsushi Enomoto (ginga@kit.hi-ho.ne.jp)
//
// (C) 2003 Atsushi Enomoto
//
// These classes represent each node of DTMXPathNavigator.
//
//#define DTM_CLASS
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Xml.XPath;
namespace Mono.Xml.XPath
{
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathLinkedNode
#else
struct DTMXPathLinkedNode
#endif
{
public int FirstChild;
public int Parent;
public int PreviousSibling;
public int NextSibling;
public int FirstAttribute;
public int FirstNamespace;
public XPathNodeType NodeType;
public string BaseURI;
public bool IsEmptyElement;
public string LocalName;
public string NamespaceURI;
public string Prefix;
public string Value;
public string XmlLang;
public int LineNumber;
public int LinePosition;
}
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathAttributeNode
#else
struct DTMXPathAttributeNode
#endif
{
public int OwnerElement;
public int NextAttribute;
public string LocalName;
public string NamespaceURI;
public string Prefix;
public string Value;
public int LineNumber;
public int LinePosition;
}
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathNamespaceNode
#else
struct DTMXPathNamespaceNode
#endif
{
public int DeclaredElement;
public int NextNamespace;
public string Name;
public string Namespace;
}
}

View File

@@ -0,0 +1,107 @@
//
// Mono.Xml.XPath.DTMXPathNode2.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// (C) 2004 Novell Inc
// Copyright 2011 Xamarin Inc (http://www.xamarin.com).
//
// These classes represent each node of DTMXPathNavigator.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Xml.XPath;
namespace Mono.Xml.XPath
{
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathLinkedNode2
#else
struct DTMXPathLinkedNode2
#endif
{
public int FirstChild;
public int Parent;
public int PreviousSibling;
public int NextSibling;
public int FirstAttribute;
public int FirstNamespace;
public XPathNodeType NodeType;
public int BaseURI;
public bool IsEmptyElement;
public int LocalName;
public int NamespaceURI;
public int Prefix;
public int Value;
public int XmlLang;
public int LineNumber;
public int LinePosition;
}
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathAttributeNode2
#else
struct DTMXPathAttributeNode2
#endif
{
public int OwnerElement;
public int NextAttribute;
public int LocalName;
public int NamespaceURI;
public int Prefix;
public int Value;
public int LineNumber;
public int LinePosition;
}
#if OUTSIDE_SYSTEM_XML
public
#else
internal
#endif
#if DTM_CLASS
class DTMXPathNamespaceNode2
#else
struct DTMXPathNamespaceNode2
#endif
{
public int DeclaredElement;
public int NextNamespace;
public int Name;
public int Namespace;
public int LineNumber;
public int LinePosition;
}
}

View File

@@ -0,0 +1,66 @@
//
// Mono.Xml.XPath.IdPattern
//
// Author:
// Ben Maurer (bmaurer@users.sourceforge.net)
//
// (C) 2003 Ben Maurer
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Xml.Xsl;
using Mono.Xml.Xsl;
namespace Mono.Xml.XPath {
internal class IdPattern : LocationPathPattern {
string [] ids;
public IdPattern (string arg0)
: base ((NodeTest) null)
{
ids = arg0.Split (XmlChar.WhitespaceChars);
}
public override XPathNodeType EvaluatedNodeType {
get { return XPathNodeType.Element; }
}
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
XPathNavigator tmp = ((XsltCompiledContext) ctx).GetNavCache (this, node);
for (int i = 0; i < ids.Length; i++)
if (tmp.MoveToId (ids [i]) && tmp.IsSamePosition (node))
return true;
return false;
}
public override double DefaultPriority { get { return 0.5; } }
}
}

View File

@@ -0,0 +1,59 @@
//
// Mono.Xml.XPath.KeyPattern
//
// Author:
// Ben Maurer (bmaurer@users.sourceforge.net)
//
// (C) 2003 Ben Maurer
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Xml.Xsl;
using Mono.Xml.Xsl;
namespace Mono.Xml.XPath
{
internal class KeyPattern : LocationPathPattern
{
XsltKey key;
public KeyPattern (XsltKey key)
: base ((NodeTest) null)
{
this.key = key;
}
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
return key.PatternMatches (node, ctx);
}
public override double DefaultPriority { get { return 0.5; } }
}
}

View File

@@ -0,0 +1,168 @@
//
// Mono.Xml.XPath.LocationPathPattern
//
// Author:
// Ben Maurer (bmaurer@users.sourceforge.net)
//
// (C) 2003 Ben Maurer
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Xml.Xsl;
using Mono.Xml.Xsl;
namespace Mono.Xml.XPath {
internal class LocationPathPattern : Pattern {
LocationPathPattern patternPrevious;
bool isAncestor;
NodeTest nodeTest;
ExprFilter filter;
public LocationPathPattern (NodeTest nodeTest)
{
this.nodeTest = nodeTest;
}
public LocationPathPattern (ExprFilter filter)
{
this.filter = filter;
while (! (filter.expr is NodeTest))
filter = (ExprFilter)filter.expr;
this.nodeTest = (NodeTest)filter.expr;
}
internal void SetPreviousPattern (Pattern prev, bool isAncestor)
{
LocationPathPattern toSet = LastPathPattern;
toSet.patternPrevious = (LocationPathPattern)prev;
toSet.isAncestor = isAncestor;
}
public override double DefaultPriority {
get {
if (patternPrevious == null && filter == null) {
NodeNameTest t = nodeTest as NodeNameTest;
if (t != null) {
if (t.Name.Name == "*" || t.Name.Name.Length == 0)
return -.25;
return 0;
}
return -.5;
}
return .5;
}
}
public override XPathNodeType EvaluatedNodeType {
get { return nodeTest.EvaluatedNodeType; }
}
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
if (! nodeTest.Match (ctx, node))
return false;
if (nodeTest is NodeTypeTest) {
// node () is different in xslt patterns
if (((NodeTypeTest)nodeTest).type == XPathNodeType.All &&
(node.NodeType == XPathNodeType.Root ||
node.NodeType == XPathNodeType.Attribute)
)
return false;
}
if (filter == null && patternPrevious == null)
return true;
XPathNavigator tmpNav;
if (patternPrevious != null) {
tmpNav = ((XsltCompiledContext) ctx).GetNavCache (this, node);
if (!isAncestor) {
tmpNav.MoveToParent ();
if (!patternPrevious.Matches (tmpNav, ctx))
return false;
} else {
while (true) {
if (!tmpNav.MoveToParent ())
return false;
if (patternPrevious.Matches (tmpNav, ctx))
break;
}
}
}
if (filter == null)
return true;
// Optimization for non-positional predicate
if (!filter.IsPositional && !(filter.expr is ExprFilter)) {
return filter.pred.EvaluateBoolean (new NullIterator (node, ctx));
}
tmpNav = ((XsltCompiledContext) ctx).GetNavCache (this, node);
tmpNav.MoveToParent ();
BaseIterator matches = filter.EvaluateNodeSet (new NullIterator (tmpNav, ctx));
while (matches.MoveNext ()) {
if (node.IsSamePosition (matches.Current))
return true;
}
return false;
}
public override string ToString ()
{
string ret = "";
if (patternPrevious != null) ret = patternPrevious.ToString () + (isAncestor ? "//" : "/");
if (filter != null) ret += filter.ToString ();
else ret += nodeTest.ToString ();
return ret;
}
public LocationPathPattern LastPathPattern {
get {
LocationPathPattern ret = this;
while (ret.patternPrevious != null)
ret = ret.patternPrevious;
return ret;
}
}
}
}

View File

@@ -0,0 +1,117 @@
//
// Mono.Xml.XPath.Pattern
//
// Author:
// Ben Maurer (bmaurer@users.sourceforge.net)
//
// (C) 2003 Ben Maurer
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Xml.Xsl;
using Mono.Xml.Xsl;
namespace Mono.Xml.XPath
{
internal abstract class Pattern
{
internal static Pattern Compile (string s, Compiler comp)
{
return Compile (comp.patternParser.Compile (s));
}
internal static Pattern Compile (Expression e)
{
if (e is ExprUNION)
return new UnionPattern (
Compile (((ExprUNION)e).left),
Compile (((ExprUNION)e).right)
);
if (e is ExprRoot)
return new LocationPathPattern (
new NodeTypeTest (Axes.Self, XPathNodeType.Root)
);
if (e is NodeTest)
return new LocationPathPattern (
(NodeTest)e
);
if (e is ExprFilter)
return new LocationPathPattern (
(ExprFilter)e
);
if (e is ExprSLASH)
{
Pattern p0 = Compile (((ExprSLASH)e).left);
LocationPathPattern p1
= (LocationPathPattern)Compile (((ExprSLASH)e).right);
p1.SetPreviousPattern (p0, false);
return p1;
}
if (e is ExprSLASH2)
{
if (((ExprSLASH2)e).left is ExprRoot)
return Compile (((ExprSLASH2)e).right);
Pattern p0 = Compile (((ExprSLASH2)e).left);
LocationPathPattern p1
= (LocationPathPattern)Compile (((ExprSLASH2)e).right);
p1.SetPreviousPattern (p0, true);
return p1;
}
if (e is XPathFunctionId)
{
ExprLiteral id = ((XPathFunctionId) e).Id as ExprLiteral;
return new IdPattern (id.Value);
}
if (e is XsltKey)
{
return new KeyPattern ((XsltKey) e);
}
return null; // throw Exception outer this method.
}
public virtual double DefaultPriority { get { return 0.5; }}
public virtual XPathNodeType EvaluatedNodeType {
get { return XPathNodeType.All; }
}
public abstract bool Matches (XPathNavigator node, XsltContext ctx);
}
}

View File

@@ -0,0 +1,66 @@
//
// Mono.Xml.XPath.UnionPattern
//
// Author:
// Ben Maurer (bmaurer@users.sourceforge.net)
//
// (C) 2003 Ben Maurer
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Schema;
using System.Xml.XPath;
using System.Xml.Xsl;
namespace Mono.Xml.XPath {
internal class UnionPattern : Pattern {
public readonly Pattern p0, p1;
public UnionPattern (Pattern p0, Pattern p1)
{
this.p0 = p0;
this.p1 = p1;
}
public override XPathNodeType EvaluatedNodeType {
get {
return p0.EvaluatedNodeType == p1.EvaluatedNodeType ?
p0.EvaluatedNodeType : XPathNodeType.All;
}
}
public override bool Matches (XPathNavigator node, XsltContext ctx)
{
return p0.Matches (node, ctx) || p1.Matches (node, ctx);
}
public override string ToString () {
return p0.ToString () + " | " + p1.ToString ();
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff