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\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.
0
majan76 (3)
6/4/2008 10:30:22 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
711 Views

Similar Articles

[PageSpeed] 2

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

Thank you
Marian
0
majan76 (3)
6/5/2008 5:51:07 AM
On 4. J=FAn, 12:30 h., MarianM <maja...@gmail.com> wrote:
> Hi all,
>
> how to validate xades xml against xades and xmlsig schemas? i have
> this sample:
>
> XmlTextReader xmlReader =3D new XmlTextReader(@"..\..\Data\xades_zep-
> epes.xml");
> XmlReaderSettings settings =3D new XmlReaderSettings();
> settings.ProhibitDtd =3D false;
> settings.ValidationType =3D ValidationType.Schema;
> settings.ValidationFlags =3D settings.ValidationFlags |
> XmlSchemaValidationFlags.ReportValidationWarnings;
> settings.ValidationEventHandler +=3D 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 =3D XmlReader.Create(xmlReader, settings))
> {
> while (valReader.Read()) { };
>
> }
>
> This code fails on "using (XmlReader valReader =3D
> XmlReader.Create(xmlReader, settings))" with
> XmlSchemaValidationException saying:
>
> "Invalid particle derivation by restriction - 'The derived elementhttp://u=
ri.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
0
majan76 (3)
6/5/2008 5:54:29 AM
Reply:

Similar Artilces:

How to create DB schema from XML schema
Hello All, We have XSD file with XML schema and want to generate database or SQL from it. Visual studio reads XSD file and shows everything graphically fine. Is there anyway, we could actually transfer the graphical information to database? Best regards, Neo ...

Data validation with a cell value linked to the same cell.
I Think that my post name is very confusing but I'll explain. I�m doing a data validation in cell f1 usig the data validation option the value entered in cell f1 need to be equal or greatter than th value in cell b2 and cell b2 is calculated with the formula =a2+c4-f1. What I'm trying to do is to prevent to enter a value in cell f1 tha I'll make cell b2 negative. But its not working, any suggetsions??? Thanks. Rodolf -- Message posted from http://www.ExcelForum.com Change your CF criterion to Formula is = F1 <= (A2+C4) In article <rodolform.161w07@excelforum-n...

How to stop pop-up re MS Office is not valid?
Every time I open Microsoft Office a pop-up stating that my program is not valid and it has Microsoft Advantage which takes me to microsoft web site wanting to sell me an updated and valid program. I am feeling harassed by this and would like to get this pop-up off my M.O. thanks for any help Buy a genuine copy of Office instead of a pirated one. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "de6lab" <de6lab@discussions.microsoft.com> wrote in message news:00A5DC2E-EB74-4645-8FC8-343E96B...

Valid CWinThread handles
Hello fellow newsgroupies! Is there a way to find out whether or not a CWinThread process has stopped or not or is still valid. I have several CWinThread's (none of which are set to auto-delete) which may occasionally finish their processes before I signal them to stop. I sometimes need to reuse these CWinThread's and restart their processes but I need to know that they are no longer running first. They may already have their stop CEvent set but the thread may have already acted on it and stopped. Their m_hThread values will not be NULL but no longer handles to valid threads. Any s...

Validation, VlookUp
I have a table with 4 columns. 3 columns (Product, Mode, City) have data that I choose in 3 validation lists. In turn, I want to match up (link) the Product, Mode and City from the lists, look them up in the table to get the number of units. I tried to use the offset /vlookup options but could not match the 3 items. As an example: Product: A, Mode: TC, City: Salem. In matching these the Number of units is 34. Formula would go in the yellow cell. Attached is the spreadsheet. Thanks......Comicfly Product Mode location Number of A TT NYC 20 A A TC Salem 34 TC A DR Richmon...

CRM 4.0
Has anyone else come across this: I create 2 new organizations: Test1 Test2 Both organizations are are brand new, never been modified. Next, I go into each one individually and create a new entity called "new_car". Save & Publish All Customizations. Then I export all the customizations from Test1 and try to import them into Test2. it blows up with an error like: Customization Import failed. Error: OrganizationUI With Id = 853ecac5-a034-419a-a4d7-a7ef70965cee Does Not Exist I can see what it's doing - it assumes if the entity name is the same, that the FormID on th...

importing schema
Hello, If I have a nice schema, created with xml spy. Can I import to visio. creating a nice visio diagram? thanks visio (and the other office products) each has their own schemas. However, that does not preclude your creating an xslt transform to map to what is appropriate to what visio requires. Chris Roth one of the MVPs has a nice presentation on some of the basics. http://www.visguy.com/2006/11/30/visio-and-xml-conference-resources/ al "greg" <greg@nospam.com> wrote in message news:u0WkWPtIHHA.780@TK2MSFTNGP03.phx.gbl... > Hello, > If I have a nice schem...

eConnect
I am developing an interface screen that will take a CSV file full of sales order information and load it into GP using eConnect. My app currently loads the orders on screen. The user can review and then click a button to send them to GP. I'd like to provide a "Validate" button so that they could find any errors (such as invalid terms code) without any orders getting updated. Is it possible to call eConnect to validate the XML without having it update anything? How? Chris, eConnect does not allow for Validation without updating. You could modify the Post proced...

validation errors
If validation fails at several places of the document, we can retrieve the line numbers of those locations using SAXParseexception. getLineNumber(), but i wnat the Xpath of that element . can that be done ...

XML Schema: Creating Datasets
I am trying to create a dataset from a published schema. The Schema is valid but when I attempt to create a dataset it complains that a column already belongs to the table. The schema I am using can be found at: http://www.westdorset-dc.gov.uk/test/bs7666-v1-2.xsd Any help appreciated Dave ...

regarding XMLDSIG
any ideas or pointers wrt XMLDSIG -- Tarun ********************************************************************** Tarundeep Singh Kalra (tarundeep1976_nospam_at_yahoo_dot_nospam_dot_com) tarun_at_tarunsadhana_dot_com visit: www.tarunsadhana.com ************************************************************************* ...

TWO QUESTIONS: Validation & Spacing...PLEASE HELP
Validation: I am in the cell that has the validation selection, but when I select validation I cannot see where the person who created the sheet put the validation choices, how can I find where he typed in his validation table of choices. Spacing: I want to have a cell where I can type three lines of text and have a space between each line without it having to go into a new cell. So I want the three lines of text and three blank lines in between in one cell. Thanks for the help. Q1- Each cell in the spreadsheet is independent; With a given cell selected, go to Data, Validation.. If di...

Schema localization
Hi, I am trying to find out the best way to localize my Schema. the problem is that i have many table with allot of columns that need to be locolized to un known number off languages. does any knows off a good artical or "best practice" for locolization -- Thank''''s Rani W RainiW What do you mean by 'localize schema'? "RaniW" <Rani@ezface.com> wrote in message news:C0CE1022-5005-4319-992C-6F7FB80B5E87@microsoft.com... > Hi, > I am trying to find out the best way to localize my Schema. > the problem is t...

Parameter values not valid #2
Hello All, After a recent disaster involving a failed Profile (now all fixed) I am trying to restore my old emails from my backup. Most of them go into the new identical folders OK but some don't and I get a message saying 'Can't move the item. Could not complete the operation. One or more parameter values is not valid.' What is happening here? Anyone any clues... Outlook 2002/XPPro Thanks, Martin ...

Copy Data Validation
XL2k....I have Data Validation in several (not all) cells from A1:J1. When I change the value, or insert one, in any cell down column A, I would like all that Data Validation information to be copied from row 1 down to the activerow, without changing any values in the activerow. I can do it by hand, but dont' seem to be able to get there with code. Any help would be apprecaited. Vaya con Dios, Chuck, CABGx3 ...

.xsd schema for RSS 2.0?
Where is an .xsd schema file for RSS 2.0? <%= Clinton Gallagher ...

XmlDocument XmlDSig schema validation
Hi! I must to validate xml document with XmlDSig and Xades Schema. Why this code (with !obsolete! XmlValidatingReader) work and validate xmldocument: private bool schemaValidationStatus = true; static void ValidationEventHandler(object sender, ValidationEventArgs e) { MessageBox.Show(e.Message); schemaValidationStatus = false; } public bool VerifySchemaVersionObsolete(string fileName) { XmlTextReader xmlTextReader = new XmlTextReader(fileName); XmlValidatingReader xmlValidatingReader = new XmlValidatingReader(xmlTextReader); xmlValidatingReader.ValidationType = ValidationType...

HTML validator
I've put up an HTML validator on my MVP Tips site. However, it may take a few hours for the files to migrate to the backup server, so it may not be immediately available if the page is served up by the backup server. This is a wrapper for the "tidy" library from http://sourceforge.net/projects/tidy/ that is designed to scale up to the problems of validating hundreds (in my case, well over a thousand) HTML pages in a single operation. It comes will full source. http://www.flounder.com/multitidy.htm joe Joseph M. Newcomer [MVP] email: newcomer@flounder.com Web: http://www.f...

Problems validating an xml file without specifying the default namespace.
Hi All, I'm trying to validate an xml document. I'm having trouble setting the default namespace of the xml document. If I hard encode the namespace in the xml file then everything works fine. But I can't do this because it breaks our old tools which validate the xml to a dtd (error saying the dtd doens't allow xmlns attribute on the root element). So I'm trying to add the default namespace to the xml file by code. As follows: string DefaultNameSpace = "http://www.mydefaultnamespace.com"; NameTable nt = new NameTable(); XmlNamespaceManager nsmgr = new XmlName...

Visio 2007 XML Schema Definition
Hi, I need to get Visio 2007 Schema Definition file (.xsd) but I could not find it. It is supposed to be in the Office2007XMLSchema.exe downloaded from http://www.microsoft.com/downloads/details.aspx?familyid=15805380-f2c0-4b80-9ad1-2cb0c300aef9&displaylang=en#Instructions but it does not. I could find the xsd file for Visio 2003 but I need the one for Visio 2007. Please help me in finding it. Thanks! DatadiagramML Schema is in the Visio SDK Documentation "emily2007" <emily2007@discussions.microsoft.com> wrote in message news:A589DAFD-756F-4CC9-861E-8CF0138AD2B3...

schema error
Hi all ! My app is a asp .net page that validate a xml using a schema. But it only works (validate the xml file) when i replace the namespace "http://tempuri.org/" in xml and xsd files with a physical path of my app "c:\inetpub\wwwroot\xml\". How can i use the virtual path ? Thank's for any help. Can you post your xml and xsd? Thanks, Priya "fivemagic" <fivemagic@bol.com.br> wrote in message news:D64E1F6E-B2B0-4592-B3FB-97E491D9EF9A@microsoft.com... > Hi all ! > > My app is a asp .net page that validate a xml using a schema. But it onl...

data validation not enforced with a named range source excel 2002 sp2
I have a cell with the following data validation settings that still allows any cell value inspite of the validation. The drop down list works, but is not enforced. How can I enforce this validation? Settings: Allow=List Ignore Blank=Yes In-cell dropdown=Yes Source="=Comment" (Comment is a named range) Input Message: Show message...=Yes Title and message entered. Error Alert: Show alert...=Yes Style=Stop Title and message entered. Source should be =Comment I don't know if that is what you have? -- Regards, Peo Sjoblom (No private emails please, for everyone'...

Validation/Duplication
I need help writing a formula for validation of entries. On the include file, rows 9 & 17 include truck numbers that our drivers use. Th problem is, I would like my dispatcher to get an error message if h enters the same truck number 2x in the same column (Example - cells D & D17 both contain truck number 2668 ). I've tried to use th Validation Rule, but it allows me to enter the same number in as man cells as I want ?! The formula I used was "=COUNTIF(D3:D299,D3)=1" but that doesn't work. Does anybody know a way of doing this ? An help would be greatly appreciated ...

validating against schema with namespaces
I have a very complex XDR schema that uses namespaces: xmlns="urn:schemas-microsoft-com:xml-data" xmlns:b="urn:schemas-microsoft-com:BizTalkServer" xmlns:d="urn:schemas-microsoft-com:datatypes" Do I need to build a custom validator in order to validate XML documents against this schema? How does the XML parser know how to validate against the extra namespaces? For example, schemas-microsoft-com:datatypes allows for attributes such as maxLength, minLength, etc. If my XML document contains a value that doesn't meet these criteria, then the document should n...

Validation...
Hi, I have created a validation in column A:A. It is possible to copy & paste any other data in column A (instead of validation data). Is there any formula with which we can restrict the data that we enter in column A i.e., data only as per validation should be accepted (no copy & paste should be accepted). Cheers, Mandeep No, validation only works for keyed data, not pasted -- Regards, Peo Sjoblom Excel 95 - Excel 2007 Northwest Excel Solutions www.nwexcelsolutions.com "It is a good thing to follow the first law of holes; if you are in one stop digging." Lord Hea...