Hi all,
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 "intelisens e 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.
This is my attempt at loading in the dtd from w3c
All the later does is stop working when i step through when it reaches the SourceUri line of the code.
If anyone can help me i would be grateful...
Harj
The Coders Advocate
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 "intelisens e 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.
Code:
XmlDocument xmld = new XmlDocument();
try
{ xmld.LoadXml(TextBox1.Text);}
catch (Exception exc)
{Response.Write(exc.Message.ToString()); }
Code:
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
Comment