Hi all,
how to validate xades xml against xades and xmlsig schemas? i have
this sample:
XmlTextReader xmlReader = new XmlTextReader(@ "..\..\Data\xad es_zep-
epes.xml");
XmlReaderSettin gs settings = new XmlReaderSettin gs();
settings.Prohib itDtd = false;
settings.Valida tionType = ValidationType. Schema;
settings.Valida tionFlags = settings.Valida tionFlags |
XmlSchemaValida tionFlags.Repor tValidationWarn ings;
settings.Valida tionEventHandle r += new
System.Xml.Sche ma.ValidationEv entHandler(sett ings_Validation EventHandler);
settings.Schema s.Add("http://www.w3.org/2000/09/xmldsig#",
XmlReader.Creat e(@"..\..\Data\ xmldsig-core-schema.xsd", settings));
settings.Schema s.Add("http://uri.etsi.org/01903/v1.3.2#", @"..\..\Data
\XAdES.xsd");
using (XmlReader valReader = XmlReader.Creat e(xmlReader, settings))
{
while (valReader.Read ()) { };
}
This code fails on "using (XmlReader valReader =
XmlReader.Creat e(xmlReader, settings))" with
XmlSchemaValida tionException 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 -- RecurseAsIfGrou p.'."
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.
how to validate xades xml against xades and xmlsig schemas? i have
this sample:
XmlTextReader xmlReader = new XmlTextReader(@ "..\..\Data\xad es_zep-
epes.xml");
XmlReaderSettin gs settings = new XmlReaderSettin gs();
settings.Prohib itDtd = false;
settings.Valida tionType = ValidationType. Schema;
settings.Valida tionFlags = settings.Valida tionFlags |
XmlSchemaValida tionFlags.Repor tValidationWarn ings;
settings.Valida tionEventHandle r += new
System.Xml.Sche ma.ValidationEv entHandler(sett ings_Validation EventHandler);
settings.Schema s.Add("http://www.w3.org/2000/09/xmldsig#",
XmlReader.Creat e(@"..\..\Data\ xmldsig-core-schema.xsd", settings));
settings.Schema s.Add("http://uri.etsi.org/01903/v1.3.2#", @"..\..\Data
\XAdES.xsd");
using (XmlReader valReader = XmlReader.Creat e(xmlReader, settings))
{
while (valReader.Read ()) { };
}
This code fails on "using (XmlReader valReader =
XmlReader.Creat e(xmlReader, settings))" with
XmlSchemaValida tionException 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 -- RecurseAsIfGrou p.'."
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.
Comment