Click here to Skip to main content
15,887,027 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: Formula to calculate Equal Monthly Payments Pin
Howard Richards22-Oct-07 5:16
Howard Richards22-Oct-07 5:16 
QuestionSimple Filter Question Pin
Glenn E. Lanier II8-Oct-07 4:35
Glenn E. Lanier II8-Oct-07 4:35 
AnswerRe: Simple Filter Question Pin
pmarfleet8-Oct-07 10:03
pmarfleet8-Oct-07 10:03 
GeneralRe: Simple Filter Question Pin
Glenn E. Lanier II8-Oct-07 10:09
Glenn E. Lanier II8-Oct-07 10:09 
QuestionXSL creation Problem Pin
Vanamaindia3-Oct-07 23:45
Vanamaindia3-Oct-07 23:45 
AnswerRe: XSL creation Problem Pin
Not Active4-Oct-07 2:22
mentorNot Active4-Oct-07 2:22 
Questionerror when adding web reference Pin
vijayaBTS3-Oct-07 21:15
vijayaBTS3-Oct-07 21:15 
QuestionSchema with Entity -- Validating Error Pin
xfun5563-Oct-07 3:08
xfun5563-Oct-07 3:08 
Hi, I wrote a Schema Validator in C#.NET.

XmlTextReader R = new XmlTextReader(FileToParse);
XmlValidatingReader V = new XmlValidatingReader(R);
try
{
XmlSchemaCollection xsc = new XmlSchemaCollection();
xsc.Add("", SchemaFile);
V.Schemas.Add(xsc);
V.EntityHandling = EntityHandling.ExpandEntities;
V.ValidationEventHandler += new ValidationEventHandler(ShowValidationErrors);
while (V.Read())
{
}
//V.Close();
//MessageBox.Show("Validation Completed");
//R.Close();
}
catch (XmlException xe)
{
//Display exceptions
}
catch (XmlSchemaException xse)
{
//Display exceptions
}
catch (Exception ee)
{
//Display exceptions
}
finally
{
V.Close();
MessageBox.Show("Validation Completed");
}

This works fine if the xml file DOES NOT contain entity declarations.

But, If the xml file contains any entity declaration (as below), the 'ValidationEventHandler' throws errors like
"Validation Error: The 'mytest' element is not declared.Line : 8 Position : 2"
"Validation Error: The 'articles' element is not declared.Line : 9 Position : 2", etc.....

How do I overcome this in C#.NET





]>

<mytest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="X:\Schema\content.xsd">
Questionxml serializer Pin
mukkanti0073-Oct-07 2:05
mukkanti0073-Oct-07 2:05 
AnswerRe: xml serializer Pin
Ilya Verbitskiy3-Oct-07 4:48
Ilya Verbitskiy3-Oct-07 4:48 
AnswerRe: xml serializer Pin
Dave Kreskowiak3-Oct-07 5:03
mveDave Kreskowiak3-Oct-07 5:03 
QuestionImage display problem Pin
SUDHAKAR PALLAM2-Oct-07 18:34
SUDHAKAR PALLAM2-Oct-07 18:34 
Questionsimple XPATH help Pin
eggie52-Oct-07 9:04
eggie52-Oct-07 9:04 
AnswerRe: simple XPATH help Pin
Scott Dorman2-Oct-07 16:45
professionalScott Dorman2-Oct-07 16:45 
QuestionUsing a custom Excel Sheet with XML code Pin
umakemesik2-Oct-07 6:14
umakemesik2-Oct-07 6:14 
QuestionHow can we acheive RSS feed through ASP.net ? Pin
jegastar1-Oct-07 19:28
jegastar1-Oct-07 19:28 
QuestionXFlat Pin
barney_19721-Oct-07 4:51
barney_19721-Oct-07 4:51 
AnswerRe: XFlat Pin
led mike1-Oct-07 5:17
led mike1-Oct-07 5:17 
GeneralRe: XFlat Pin
barney_19721-Oct-07 5:44
barney_19721-Oct-07 5:44 
GeneralRe: XFlat Pin
George L. Jackson1-Oct-07 6:05
George L. Jackson1-Oct-07 6:05 
GeneralRe: XFlat Pin
led mike1-Oct-07 6:21
led mike1-Oct-07 6:21 
GeneralRe: XFlat Pin
George L. Jackson1-Oct-07 7:02
George L. Jackson1-Oct-07 7:02 
AnswerRe: How to get the element values based on the index. Pin
led mike1-Oct-07 5:04
led mike1-Oct-07 5:04 
Questionxml serilization Pin
seemamltn28-Sep-07 11:41
seemamltn28-Sep-07 11:41 
QuestionXML serialization with an array Pin
cholo1027-Sep-07 3:28
cholo1027-Sep-07 3:28 

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.