I am writing a form for end users to input XHTML that will be displayed on the site.
I know that is way too much trust for my users but what can you say you gotta do what the boss wants. Anyway ...
How do i validate the input, i "intelisense browsed" and i worked out how to validate xml, but i can't get it to change the schema it uses.
This is the standard xml parser.
Expand|Select|Wrap|Line Numbers
- XmlDocument xmld = new XmlDocument();
- try
- { xmld.LoadXml(TextBox1.Text);}
- catch (Exception exc)
- {Response.Write(exc.Message.ToString()); }
Expand|Select|Wrap|Line Numbers
- XmlSchemaSet sch = new XmlSchemaSet();
- XmlSchema xmlSch = new XmlSchema();
- XmlSchemaSet schcopy = new XmlSchemaSet();
- xmlSch.SourceUri = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
- xmlSch.Namespaces.Add("xmlns", "http://www.w3.org/1999/xhtml");
- sch.Add(xmlSch);
If anyone can help me i would be grateful...
Harj
The Coders Advocate