473,799 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlDSig and XAdES schema validation

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.
Jun 27 '08 #1
2 6381
The whole solution with sample xml and xsd can be downloaded from
http://test.ditec.sk/xmlvalidation.zip.

Thank you
Marian
Jun 27 '08 #2
On 4. Jún, 12:30 h., MarianM <maja...@gmail. comwrote:
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 elementhttp://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.

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

Thank you
Marian
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3135
by: kk | last post by:
I can't figure out why XMLSpy can't validate pass the following schema segment: <?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://www.mydomain.com/myschema" xmlns:myns="http://www.mydomain.com/myschema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
0
3596
by: Thomas Brathans | last post by:
Hello, at the moment I'm trying to familiarize me with XAdES - it would be helpful, if I had besides "http://www.w3.org/TR/XAdES/" some further information. Mainly some illustrative examples would be very appreciated. My main focus is on timestamping-aspects, which means XAdES-T, XAdES-X and XAdES-A. Thanks...
4
5611
by: joes | last post by:
Hello there I tried for several days to get a simple validation with xml schema & xerces working. Goal for me is tuse JAXP and not specific Xerces classes. I don't get the point what I am doing wrong. Could somebody help me? I didn't find any full example working on the net. Thank you for any hints! If I run the examples below, the parsers parses the file well, no vlaidation is occuring although the schema and xml file does not
2
2153
by: wumingshi | last post by:
Hi, When validating an XML instance, sometimes the schema is not enough to expression the validation rules. Additional validation rules may be expressed in an application-specific way. For example, using XPath or Java method. So is there a concept and/or standard for post-schema validation or application validation? Is there any hook in XML standards that allow me to hook up with my customized validation? Additionally and more...
2
9453
by: Shone | last post by:
I would like to perform a 2-pass XML reading from a stream. Once using the Validating reader, just to confirm the validity against the schema, and next time to do a reading to extract the data. Actually, second time I do a deserialization, the data from XML is fed directly to an object. The problem I am experiencing is the error at the second reading attempt, and error description implies that reader is winded to the end of the XML and...
0
1253
by: Dave | last post by:
Hi all, I'm looking at designing an XSD for a signed document (enveloping) to be received from a third party. Primarily, I'm interested in what is the "best practice" with regards the following: 1) Should the XSD "import" the standard xmldsig schemas and add the signature element to the XSD or is this implied and not normally represented
1
6410
by: billa1972 | last post by:
Hi, I am trying to hook into Yellow Freight's rating webservice. Below is the wsdl. When i try and create a proxy file with wsdl.exe i get the following errors, see below. Also, when i reference this wsdl in .NET it seems to do it fine, yet there are no objects to reference except RateQuoteBeanService. In the WSDL it looks like there should be getRateQuote, and QUOTEREQUEST, etc.
0
2024
by: Senshodan | last post by:
Does anyone know if there is support for XADES in .NET? If so, which is the assembly responsible for that? If MS doesn't support XADES is there any third part assembly implementing that functionality? Thanks in advance.
0
2694
by: Mark Parter | last post by:
I'm trying convert an XML Schema (http://www.elframework.org/projects/xcri/efc_r1.0.xsd/view) to a VB.Net class using the XSD tool provided with the .NET 2 SDK. However, it's failing to generate the class and is outputting the following error(s); Schema validation warning: Undefined complexType 'http://purl.org/dc/elements/1.1/:SimpleLiteral' is used as a base for complex type extension. Line 433, position 5. Schema validation warning:...
0
9686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10250
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.