UnionPattern.cs 710 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Mono.Xml.XPath.UnionPattern
  3. //
  4. // Author:
  5. // Ben Maurer ([email protected])
  6. //
  7. // (C) 2003 Ben Maurer
  8. //
  9. using System;
  10. using System.Collections;
  11. using System.IO;
  12. using System.Xml;
  13. using System.Xml.Schema;
  14. using System.Xml.XPath;
  15. using System.Xml.Xsl;
  16. namespace Mono.Xml.XPath {
  17. internal class UnionPattern : Pattern {
  18. public readonly Pattern p0, p1;
  19. public UnionPattern (Pattern p0, Pattern p1)
  20. {
  21. this.p0 = p0;
  22. this.p1 = p1;
  23. }
  24. public override bool Matches (XPathNavigator node, XsltContext ctx)
  25. {
  26. return p0.Matches (node, ctx) || p1.Matches (node, ctx);
  27. }
  28. public override string ToString () {
  29. return p0.ToString () + " | " + p1.ToString ();
  30. }
  31. }
  32. }