private RelaxngText ReadTextPattern() { expect("text"); if (MoveToFirstAttribute()) { do { if (NamespaceURI == String.Empty && LocalName != "datatypeLibrary") { throw new RelaxngException("Invalid attribute."); } } while (MoveToNextAttribute()); MoveToElement(); } if (!IsEmptyElement) { Read(); expectEnd("text"); } else { Read(); } RelaxngText t = new RelaxngText(); FillLocation(t); return(t); }
private RelaxngText ReadTextPattern () { expect ("text"); if (MoveToFirstAttribute ()) { do { if (NamespaceURI == String.Empty && LocalName != "datatypeLibrary") throw new RelaxngException ("Invalid attribute."); } while (MoveToNextAttribute ()); MoveToElement (); } if (!IsEmptyElement) { Read (); expectEnd ("text"); } else Read (); RelaxngText t = new RelaxngText (); FillLocation (t); return t; }
RelaxngPattern CreateElement (XmlSchemaElement xse) { if (xse.RefName != XmlQualifiedName.Empty) { RelaxngRef r = new RelaxngRef (); r.Name = xse.RefName.Name; // namespace means nothing here. return r; } RelaxngElement re = new RelaxngElement (); RelaxngName name = new RelaxngName (); name.LocalName = xse.Name; re.NameClass = name; XmlSchemaComplexType ct = xse.SchemaType as XmlSchemaComplexType; foreach (XmlSchemaAttribute a in ct.Attributes) re.Patterns.Add (CreateAttribute (a)); RelaxngPattern rpart; if (ct.Particle == null) rpart = new RelaxngEmpty (); else rpart = CreatePatternFromParticle (ct.Particle); if (ct.IsMixed) { if (rpart.PatternType != RelaxngPatternType.Empty) { RelaxngMixed mixed = new RelaxngMixed (); mixed.Patterns.Add (rpart); rpart = mixed; } else { rpart = new RelaxngText (); } } re.Patterns.Add (rpart); return re; }
public void WriteText (RelaxngText text) { w.Write ("text "); }