XmlSchemaGroupRef.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Author: Dwivedi, Ajay kumar
  2. // [email protected]
  3. using System;
  4. using System.Xml;
  5. using System.Xml.Serialization;
  6. namespace System.Xml.Schema
  7. {
  8. /// <summary>
  9. /// Summary description for XmlSchemaGroupRef.
  10. /// </summary>
  11. public class XmlSchemaGroupRef : XmlSchemaParticle
  12. {
  13. private XmlSchemaGroupBase particle;
  14. private XmlQualifiedName refName;
  15. private int errorCount=0;
  16. public XmlSchemaGroupRef()
  17. {
  18. refName = XmlQualifiedName.Empty;
  19. }
  20. [XmlIgnore]
  21. public XmlSchemaGroupBase Particle
  22. {
  23. get{ return particle; }
  24. }
  25. [System.Xml.Serialization.XmlAttribute("ref")]
  26. public XmlQualifiedName RefName
  27. {
  28. get{ return refName; }
  29. set{ refName = value; }
  30. }
  31. /// <remarks>
  32. /// 1. RefName must be present
  33. /// </remarks>
  34. [MonoTODO]
  35. internal int Compile(ValidationEventHandler h, XmlSchemaInfo info)
  36. {
  37. if(refName == null || refName.IsEmpty)
  38. {
  39. error(h,"ref must be present");
  40. }
  41. if(this.Id != null && !XmlSchemaUtil.CheckID(Id))
  42. error(h, "id must be a valid ID");
  43. return errorCount;
  44. }
  45. [MonoTODO]
  46. internal int Validate(ValidationEventHandler h)
  47. {
  48. return errorCount;
  49. }
  50. internal void error(ValidationEventHandler handle,string message)
  51. {
  52. errorCount++;
  53. ValidationHandler.RaiseValidationError(handle,this,message);
  54. }
  55. }
  56. }