Esempio n. 1
0
    public static void Main()
    {
        XmlSchema schema = new XmlSchema();

        // <xs:notation name="jpeg" public="image/jpeg" system="viewer.exe" />
        XmlSchemaNotation notation = new XmlSchemaNotation();

        notation.Name   = "jpeg";
        notation.Public = "image/jpeg";
        notation.System = "viewer.exe";

        schema.Items.Add(notation);

        XmlSchemaSet schemaSet = new XmlSchemaSet();

        schemaSet.ValidationEventHandler += new ValidationEventHandler(ValidationCallbackOne);
        schemaSet.Add(schema);
        schemaSet.Compile();

        XmlSchema compiledSchema = null;

        foreach (XmlSchema schema1 in schemaSet.Schemas())
        {
            compiledSchema = schema1;
        }

        XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());

        nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema");
        compiledSchema.Write(Console.Out, nsmgr);
    }
Esempio n. 2
0
    } //WriteXmlSchemaGroup()

    //XmlSchemaNotation
    public static void WriteXmlSchemaNotation(XmlSchemaNotation notation, XmlTextWriter myXmlTextWriter)
    {
        myXmlTextWriter.WriteStartElement("notation", XmlSchema.Namespace);
        myXmlTextWriter.WriteAttributeString(null, "name", XmlSchema.Namespace, notation.Name);
        myXmlTextWriter.WriteAttributeString(null, "public", XmlSchema.Namespace, notation.Public);
        myXmlTextWriter.WriteAttributeString(null, "system", XmlSchema.Namespace, notation.System);
        myXmlTextWriter.WriteEndElement();
    } //WriteXmlSchemaNotation()
Esempio n. 3
0
	public void DumpNotation (XmlSchemaNotation n)
	{
		depth++;

		IndentLine ("**Notation**");
		IndentLine ("Name: " + n.Name);


		depth--;
	}
Esempio n. 4
0
        internal XSNotationDeclaration(XmlSchemaNotation xmlNotation)
        {
            _notation = xmlNotation;

            if (_notation.Annotation is XmlSchemaAnnotation annotation)
            {
                _annotation = XMLSchemaSerializer.CreateXSAnnotation(annotation);
                _annotation.BindToContainer(RootContainer, this);
            }
        }
Esempio n. 5
0
 private static void Equal(XmlSchemaNotation expected, XmlSchemaNotation actual)
 {
     throw new NotImplementedException();
 }
Esempio n. 6
0
 protected virtual void Visit(XmlSchemaNotation notation)
 {
 }
Esempio n. 7
0
    } //WriteXmlSchemaGroup()

    //XmlSchemaNotation
    public static void WriteXmlSchemaNotation(XmlSchemaNotation notation, XmlTextWriter myXmlTextWriter)
    {
      myXmlTextWriter.WriteStartElement("notation", XmlSchema.Namespace);
      myXmlTextWriter.WriteAttributeString(null, "name", XmlSchema.Namespace, notation.Name);
      myXmlTextWriter.WriteAttributeString(null, "public", XmlSchema.Namespace, notation.Public);
      myXmlTextWriter.WriteAttributeString(null, "system", XmlSchema.Namespace, notation.System);
      myXmlTextWriter.WriteEndElement();
    } //WriteXmlSchemaNotation()