473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

validating Xhtml Strict with Csharp

harshmaul
490 Expert 256MB
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 "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
  1.         XmlDocument xmld = new XmlDocument();
  2.         try
  3.         { xmld.LoadXml(TextBox1.Text);}
  4.         catch (Exception exc)
  5.         {Response.Write(exc.Message.ToString()); }
  6.  
This is my attempt at loading in the dtd from w3c
Expand|Select|Wrap|Line Numbers
  1.         XmlSchemaSet sch = new XmlSchemaSet();
  2.         XmlSchema xmlSch = new XmlSchema();
  3.         XmlSchemaSet schcopy = new XmlSchemaSet();
  4.  
  5.         xmlSch.SourceUri = "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";
  6.         xmlSch.Namespaces.Add("xmlns", "http://www.w3.org/1999/xhtml");
  7.         sch.Add(xmlSch);
  8.  
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
Dec 12 '07 #1
2 1165
radcaesar
759 Expert 512MB
System.XML.Schema.XmlSeverityType
Dec 12 '07 #2
harshmaul
490 Expert 256MB
hi,
Thanks for the response. However you gave me an enum, with no direction. can you give me an object or something that i can browse.
Dec 12 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

24
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I...
30
by: Toni Mcintyre | last post by:
i'm having 2 problems with the http://validator.w3.org 1. if i have: <meta http-equiv="Content-Script-Type" content="text/javascript"> then why do i need <script type=text/javascript>...
6
by: mike | last post by:
Hello, After trying to validate this page for a couple of days now I was wondering if someone might be able to help me out. Below is a list of snippets where I am having the errors. 1. Line 334,...
35
by: The Bicycling Guitarist | last post by:
My web site has not been spidered by Googlebot since April 2003. The site in question is at www.TheBicyclingGuitarist.net/ I received much help from this NG and the stylesheets NG when updating the...
16
by: Peter Maas | last post by:
The XHTML file below creates a 2x2 matrix of square images. There is always some space at the bottom borders of the cells (when rendered with Gecko and KHTML, not with IE) and I've found no way so...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
2
by: Joris Janssens | last post by:
I'm trying to write a program for validating XHTML 1.1-documents against the XHTML 1.1 DTD (which is actually the same as validating an XML-file) but I always get a "(404) Not found" error. This...
2
by: PapaRandy | last post by:
Hello, I am trying to validate the following .py webpage as HTML (through W3C). I put: ----------------------------------------------------------------------------- print "Content-type:...
8
by: cutlass | last post by:
Need you assistance to anyone who is willing to offer. I have been working on this script and can't get it to work. The issue I'm having is the statement: function validateSender($Address)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.