Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

XmlDSig and XAdES schema validation

Question posted by: MarianM (Guest) on June 27th, 2008 07:20 PM
Hi all,

how to validate xades xml against xades and xmlsig schemas? i have
this sample:

XmlTextReader xmlReader = new XmlTextReader(@"..\..\Data\xades_zep-
epes.xml");
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
settings.ValidationType = ValidationType.Schema;
settings.ValidationFlags = settings.ValidationFlags |
XmlSchemaValidationFlags.ReportValidationWarnings;
settings.ValidationEventHandler += new
System.Xml.Schema.ValidationEventHandler(settings_ ValidationEventHandler);

settings.Schemas.Add("http://www.w3.org/2000/09/xmldsig#",
XmlReader.Create(@"..\..\Data\xmldsig-core-schema.xsd", settings));
settings.Schemas.Add("http://uri.etsi.org/01903/v1.3.2#", @"..\..\Data
\XAdES.xsd");

using (XmlReader valReader = XmlReader.Create(xmlReader, settings))
{
while (valReader.Read()) { };
}



This code fails on "using (XmlReader valReader =
XmlReader.Create(xmlReader, settings))" with
XmlSchemaValidationException saying:

"Invalid particle derivation by restriction - 'The derived element
http://uri.etsi.org/01903/v1.3.2#:Include at (113, 12) is not a valid
restriction of the base choice particle at (95, 8) according to
Elt:All/Choice/Sequence -- RecurseAsIfGroup.'."

Is something wrong with my code, or schema (which is from
uri.etsi.org) or ms implementation?
Can anybody help me?

Many many thax...
Marian.
MarianM's Avatar
MarianM
Guest
n/a Posts
June 27th, 2008
07:20 PM
#2

Re: XmlDSig and XAdES schema validation
The whole solution with sample xml and xsd can be downloaded from
http://test.ditec.sk/xmlvalidation.zip.

Thank you
Marian

MarianM's Avatar
MarianM
Guest
n/a Posts
June 27th, 2008
07:20 PM
#3

Re: XmlDSig and XAdES schema validation
On 4. Jún, 12:30 h., MarianM <maja...@gmail.comwrote:
Quote:
Hi all,
>
how to validate xades xml against xades and xmlsig schemas? i have
this sample:
>
XmlTextReader xmlReader = new XmlTextReader(@"..\..\Data\xades_zep-
epes.xml");
XmlReaderSettings settings = new XmlReaderSettings();
settings.ProhibitDtd = false;
settings.ValidationType = ValidationType.Schema;
settings.ValidationFlags = settings.ValidationFlags |
XmlSchemaValidationFlags.ReportValidationWarnings;
settings.ValidationEventHandler += new
System.Xml.Schema.ValidationEventHandler(settings_ ValidationEventHandler);
>
settings.Schemas.Add("http://www.w3.org/2000/09/xmldsig#",
XmlReader.Create(@"..\..\Data\xmldsig-core-schema.xsd", settings));
settings.Schemas.Add("http://uri.etsi.org/01903/v1.3.2#", @"..\..\Data
\XAdES.xsd");
>
using (XmlReader valReader = XmlReader.Create(xmlReader, settings))
{
while (valReader.Read()) { };
>
}
>
This code fails on "using (XmlReader valReader =
XmlReader.Create(xmlReader, settings))" with
XmlSchemaValidationException saying:
>
"Invalid particle derivation by restriction - 'The derived elementhttp://uri.etsi.org/01903/v1.3.2#:Includeat (113, 12) is not a valid
restriction of the base choice particle at (95, 8) according to
Elt:All/Choice/Sequence -- RecurseAsIfGroup.'."
>
Is something wrong with my code, or schema (which is from
uri.etsi.org) or ms implementation?
Can anybody help me?
>
Many many thax...
Marian.



The whole solution with sample xml and xsd can be downloaded from
http://test.ditec.sk/xmlvalidation.zip.

Thank you
Marian

 
Not the answer you were looking for? Post your question . . .
189,877 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
  • Didn't find the answer you were looking for?
    Post Your Question
  • Top Community Contributors