473,382 Members | 1,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

how to validate XML against one given xsd file


For example the XML looks like:

<SOAP-ENV:Body>

<samlp:Response InResponseTo="abcd"
IssueInstant="2005-02-03T20:18:06Z" MajorVersion="1" MinorVersion="0"
ResponseID="abcd">

<samlp:Status>
<samlp:StatusCode Value="samlp:Success"/>
</samlp:Status>

<saml:Assertion AssertionID="12343" InResponseTo="1234"
IssueInstant="2005-02-03T20:18:06Z" Issuer="http://www.fmr.com"
MajorVersion="1" MinorVersion="0" id="id-gLxbrihSvyx3"
xsi:type="lib:AssertionType">

<saml:Conditions>

<saml:AudienceRestrictionCondition>
<saml:Audience>abcd</saml:Audience>
</saml:AudienceRestrictionCondition>
</saml:Conditions>


the XSD file is:

<?xml version="1.0" encoding="UTF-8" ?>
<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:asser tion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" attributeFormDefault="unqualified"
version="1.1">
<import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"
/>
<annotation>
<documentation>Document identifier:
oasis-sstc-saml-schema-assertion-1.1 Location:
http://www.oasis-open.org/committees...bbrev=security
Revision history: V1.0 (November, 2002): Initial standard schema. V1.1
(September, 2003): * Note that V1.1 of this schema has the same XML
namespace as V1.0. Rebased ID content directly on XML Schema types
Added DoNotCacheCondition element and
DoNotCacheConditionType</documentation>
</annotation>
<simpleType name="DecisionType">
<restriction base="string">
<enumeration value="Permit" />
<enumeration value="Deny" />
<enumeration value="Indeterminate" />
</restriction>
</simpleType>
<element name="AssertionIDReference" type="NCName" />
<element name="Assertion" type="saml:AssertionType" />
<complexType name="AssertionType">

Jul 20 '05 #1
2 3833
ja******@gmail.com wrote in message news:<11**********************@f14g2000cwb.googleg roups.com>...
For example the XML looks like:

<SOAP-ENV:Body>

<samlp:Response InResponseTo="abcd"
IssueInstant="2005-02-03T20:18:06Z" MajorVersion="1" MinorVersion="0"
ResponseID="abcd">

<samlp:Status>
<samlp:StatusCode Value="samlp:Success"/>
</samlp:Status>

<saml:Assertion AssertionID="12343" InResponseTo="1234"
IssueInstant="2005-02-03T20:18:06Z" Issuer="http://www.fmr.com"
MajorVersion="1" MinorVersion="0" id="id-gLxbrihSvyx3"
xsi:type="lib:AssertionType">

<saml:Conditions>

<saml:AudienceRestrictionCondition>
<saml:Audience>abcd</saml:Audience>
</saml:AudienceRestrictionCondition>
</saml:Conditions>


the XSD file is:

<?xml version="1.0" encoding="UTF-8" ?>
<schema targetNamespace="urn:oasis:names:tc:SAML:1.0:asser tion"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified" attributeFormDefault="unqualified"
version="1.1">
<import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd"
/>
<annotation>
<documentation>Document identifier:
oasis-sstc-saml-schema-assertion-1.1 Location:
http://www.oasis-open.org/committees...bbrev=security
Revision history: V1.0 (November, 2002): Initial standard schema. V1.1
(September, 2003): * Note that V1.1 of this schema has the same XML
namespace as V1.0. Rebased ID content directly on XML Schema types
Added DoNotCacheCondition element and
DoNotCacheConditionType</documentation>
</annotation>
<simpleType name="DecisionType">
<restriction base="string">
<enumeration value="Permit" />
<enumeration value="Deny" />
<enumeration value="Indeterminate" />
</restriction>
</simpleType>
<element name="AssertionIDReference" type="NCName" />
<element name="Assertion" type="saml:AssertionType" />
<complexType name="AssertionType">

On my linux platform, I use:
xmllint --schema <mySchema.xsd> <myXml.xml>

-
Fabien
Jul 20 '05 #2
Thanks..

Jul 20 '05 #3

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

Similar topics

1
by: Adib Taraben | last post by:
Hi, I use libxml in C/C++. I have an xml-file that has a dtd-definition. and I have an other dtd that has not the same name as in the xml-file. How can I validate that xml-file against my...
9
by: Leona | last post by:
Hello all, does anyone know of a tool, preferably free, preferably on linux, which will take an xml file and validate it against your own custom W3C XML Schema file (.xsd) ?? All help...
1
by: Ron Rohrssen | last post by:
I've been working on learning XML schemas and trying to make use of the MS classes for validating data against a schema. So, I've been trying to work through some simple schemas and instances....
1
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
7
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for...
4
by: Mr. x | last post by:
Hello, I know about the validator on : http://validator.w3.org , which can validate html pages. I just new to this validator. How can I validate (if it can be - by this validator) aspx pages,...
3
by: Rushi | last post by:
Hi All, Is it possible to Validate XML against XSD using two different XML files. scenario: There are two different XML file, one file contain element and count information and other one...
6
by: Jonny | last post by:
Hi, I'm trying to validate my xml against a xsd but I can't get it to work. Originally, I wanted to validate an xml string but since I didn't get that to work I tried to validate an xml file...
0
by: anupam roy | last post by:
Hi, I have created my own XML text editor and using XmlReader to read the xml files I have opened one xml file for editing in the text box editor( i have . Now before saving the file, i want to...
2
by: hrishy | last post by:
Hi Does anybody have a python xample program to validate a xml file against a XSD. regards Hrisy
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.