Click here to Skip to main content
15,881,803 members
Home / Discussions / C#
   

C#

 
AnswerRe: Panel Event Pin
Calin Tatar3-Mar-09 3:34
Calin Tatar3-Mar-09 3:34 
GeneralRe: Panel Event [modified] Pin
Megidolaon4-Mar-09 2:30
Megidolaon4-Mar-09 2:30 
QuestionOdd Referencing Problem Pin
Jammer3-Mar-09 1:55
Jammer3-Mar-09 1:55 
AnswerRe: Odd Referencing Problem Pin
ABitSmart3-Mar-09 3:15
ABitSmart3-Mar-09 3:15 
GeneralRe: Odd Referencing Problem Pin
Jammer3-Mar-09 3:18
Jammer3-Mar-09 3:18 
AnswerRe: Odd Referencing Problem Pin
led mike3-Mar-09 4:20
led mike3-Mar-09 4:20 
GeneralRe: Odd Referencing Problem Pin
Jammer3-Mar-09 5:11
Jammer3-Mar-09 5:11 
Questionc# and XML validation [modified] Pin
mocasu3-Mar-09 0:51
mocasu3-Mar-09 0:51 
Hi there,

I have created an .xsd schema which I want to include in my project (Windows Service). First question is: what is the best way to include it? as a resource? or just by doing "Add existing item"? what is the difference(if any)?

So far, I have added it as a resource (jobs.xsd). Ok, so now I want to validate an xml file, thus I am trying to do as follows:
1. XmlSchemaSet xss = new XmlSchemaSet();
2. //Add the schema to the collection
3.  xss.Add("http://www.w3.org/2001/XMLSchema",ClassLibrary1.Properties.Resources.jobs);
4.  XmlReaderSettings settings = new XmlReaderSettings();
5.  settings.ValidationType = ValidationType.Schema;
6.  settings.Schemas = xss;
7. settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack);
8. // Create the XmlReader object.
9. XmlReader reader = XmlReader.Create(xmlPath, settings);
10. // Parse the file. 
11. while (reader.Read()){};

This code breaks on line 3, with a System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.Path.GetFullPath(String path)
at System.Xml.XmlResolver.ResolveUri(Uri baseUri, String relativeUri)
at System.Xml.XmlUrlResolver.ResolveUri(Uri baseUri, String relativeUri)
at System.Xml.Schema.XmlSchemaSet.Add(String targetNamespace, String schemaUri)
at ClassLibrary1.ReadXml.ValidateXMLAgainstXSD(String xmlPath) in c:\myproj\ClassLibrary1\GetXml.cs:line 95}

How could I get around this problem?

Cheers

modified on Tuesday, March 3, 2009 6:57 AM

AnswerRe: c# and XML validation Pin
Greg Chelstowski3-Mar-09 3:29
Greg Chelstowski3-Mar-09 3:29 
GeneralRe: c# and XML validation Pin
mocasu3-Mar-09 4:55
mocasu3-Mar-09 4:55 
Questionis there in tool available in c#.net to resizeing of images? Pin
poonam jagdale3-Mar-09 0:20
poonam jagdale3-Mar-09 0:20 
AnswerRe: is there in tool available in c#.net to resizeing of images? Pin
stancrm3-Mar-09 3:32
stancrm3-Mar-09 3:32 
AnswerRe: is there in tool available in c#.net to resizeing of images? Pin
Shyam K Pananghat3-Mar-09 3:42
Shyam K Pananghat3-Mar-09 3:42 
QuestionRegex to find the Code blocks using C# Pin
aaCog2-Mar-09 23:59
aaCog2-Mar-09 23:59 
AnswerRe: Regex to find the Code blocks using C# Pin
musefan3-Mar-09 2:47
musefan3-Mar-09 2:47 
AnswerRe: Regex to find the Code blocks using C# Pin
PIEBALDconsult3-Mar-09 3:54
mvePIEBALDconsult3-Mar-09 3:54 
GeneralRe: Regex to find the Code blocks using C# Pin
aaCog3-Mar-09 16:53
aaCog3-Mar-09 16:53 
Questionkrish Pin
krishnakarthik2-Mar-09 23:29
krishnakarthik2-Mar-09 23:29 
AnswerRe: krish Pin
Calin Tatar3-Mar-09 0:03
Calin Tatar3-Mar-09 0:03 
AnswerRe: krish Pin
Ashfield3-Mar-09 1:52
Ashfield3-Mar-09 1:52 
Questionaccess denied Pin
shefa' isied2-Mar-09 23:21
shefa' isied2-Mar-09 23:21 
AnswerRe: access denied Pin
monstale2-Mar-09 23:50
monstale2-Mar-09 23:50 
GeneralRe: access denied Pin
shefa' isied3-Mar-09 0:05
shefa' isied3-Mar-09 0:05 
GeneralRe: access denied Pin
EliottA3-Mar-09 3:00
EliottA3-Mar-09 3:00 
AnswerRe: access denied Pin
monstale3-Mar-09 4:19
monstale3-Mar-09 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.