Merge pull request #1155 from steffen-kiess/json-string
[mono.git] / mcs / class / Commons.Xml.Relaxng / Commons.Xml.Relaxng.Derivative / RdpPatterns.cs
index a729b8db56bc0f70d9a9fe8b0121478af1b7b579..b65e59f33575c873b7d4274556f707350e622f19 100644 (file)
@@ -48,6 +48,16 @@ namespace Commons.Xml.Relaxng.Derivative
        // for now).
        public abstract class RdpPattern
        {
+               public static readonly RdpPattern Anything;
+
+               static RdpPattern ()
+               {
+                       RdpPattern anyAtts = new RdpList (new RdpAttribute (RdpAnyName.Instance, RdpText.Instance));
+                       RdpElement anyElement = new RdpElement (RdpAnyName.Instance, null);
+                       Anything = new RdpChoice (RdpEmpty.Instance, new RdpChoice (anyAtts, new RdpChoice (RdpText.Instance, new RdpList (anyElement))));
+                       anyElement.Children = Anything;
+               }
+
                internal bool nullableComputed;
                internal bool isNullable;
                Hashtable patternPool;
@@ -2125,12 +2135,12 @@ namespace Commons.Xml.Relaxng.Derivative
                        constraintsChecked = true;
                        if (attribute || list || dataExcept)
                                throw new RelaxngException ("Not allowed element occurence was specified in the pattern.");
-                       this.Children.CheckConstraints (false, oneOrMore, oneOrMoreGroup, oneOrMoreInterleave, false, false);
+                       this.Children.CheckConstraints (false, false, false, oneOrMoreInterleave, false, false);
                }
 
                internal override bool ContainsText()
                {
-                       return children.ContainsText ();
+                       return false;
                }
        }