Exemplo n.º 1
0
 private void ReadPatterns(RelaxngSingleContentPattern el)
 {
     do
     {
         el.Patterns.Add(ReadPattern());
     } while (NodeType == XmlNodeType.Element);
 }
Exemplo n.º 2
0
		private void ReadPatterns (RelaxngSingleContentPattern el)
		{
			do {
				el.Patterns.Add (ReadPattern ());
			} while (NodeType == XmlNodeType.Element);
		}
Exemplo n.º 3
0
		private void ProcessLax (RelaxngSingleContentPattern scp)
		{
			RelaxngChoice c = (RelaxngChoice) scp.Patterns [0];
			foreach (RelaxngPattern p in c.Patterns) {
				RelaxngRef el = p as RelaxngRef;
				if (el == null) {
					RelaxngOneOrMore oom =
						(RelaxngOneOrMore) p;
					el = (RelaxngRef) oom.Patterns [0];
				}
				if (el == null)
					throw Error (c, String.Format ("Target pattern contains unacceptable child pattern {0}. Only ref is allowed here."));
				if (ElementMatches (el)) {
					InferElement (el, false);
					return;
				}
			}
			// append a new element particle to lax term.
			QName qname = new QName (
				source.LocalName, source.NamespaceURI);
			RelaxngDefine def = GetGlobalElement (qname);
			if (def == null) {
				def = CreateGlobalElement (qname); // used to be CreateElement().
				InferElement (def, true);
			}
			else
				InferElement (def, false);
			RelaxngRef nel = new RelaxngRef ();
			nel.Name = def.Name;
			c.Patterns.Add (nel);
		}