XSD validations are used to validate the XML file against the stored schema.
Questions tagged [xsd-validation]
1640 questions
6
votes
1 answer
XSD/Schema validation workaround in .net core?
I got from https://github.com/dotnet/corefx/issues/3633, that XSD Schema Validation now is not yet supported, and planned in .Net Core 1.2.0 whose release date is Spring, 2017.
However it's one of the key features of our product, so it somehow has…

Elaine
- 1,288
- 5
- 17
- 35
6
votes
1 answer
XSD Error: This element is not expected
I was writing an XSD to validate a XML, but when I was validating this error appeared:
Output - error
Validation of current file using XML Schema:
ERROR: Element '{http://www.w3.org/2001/XMLSchema-instance}Gasto':
This element is not expected.…

Joseph
- 159
- 2
- 4
- 12
6
votes
1 answer
XDocument.Validate - Expected Data Type of error element
I have a class which validates the supplied XML document against the supplied XSD. In the class I call the XDocument.Validate method to perform validation, and getting the following error:
The…

Pradeep Kumar
- 6,836
- 4
- 21
- 47
6
votes
1 answer
How to create an xml schema with key/keyrefs for nested elements of the same type
I work with some XML files on a regular basis and want to have better validation then a DTD can provide. So I started reading about schemas to see if would help me out. So far I've been able to create something that works almost like I need except…

Chuck
- 159
- 4
6
votes
2 answers
how to simulate lack of network connectivity in unit testing
The general question is how to simulate (as part of a JUnit suite of test cases) lack of network connectivity as this is an important consideration in some test cases. Is there a way to do so via a Java API (or via a JVM option) so that certain test…

Marcus Junius Brutus
- 26,087
- 41
- 189
- 331
6
votes
1 answer
How to make type depend on attribute value using Conditional Type Assignment
I have an XML file like this
I'd like to make an XSD, so that if the value of the attribute "type" is 1, the…

DropDropped
- 1,253
- 1
- 22
- 50
6
votes
1 answer
XSD Two elements with the same name but different attribute value
I am trying to define an XSD template for the following:
Zluty
Žlutý
So far, I've come up with
…

Humungus
- 575
- 2
- 5
- 16
6
votes
1 answer
Is there an alternative to in XML Schema 1.0
I have a XSD document fragment below. When an XML file validates against this schema I wish to ensure that the value in mm:Depot and mm:Customer/mm:County are the same and restricted to items in the Location type.
This can be done in XML Schema…

cymorg
- 534
- 2
- 10
- 27
6
votes
1 answer
How to declare a complexType has only one child element?
When using XML Schema to declare that a complexType has just one child element, all the below three approaches achieve the goal:
…

MengT
- 1,207
- 2
- 14
- 16
6
votes
1 answer
How to add conditional validation in XSD :
Existing XSD Snippet:

user2432281
- 61
- 1
- 1
- 2
6
votes
2 answers
XML validation and namespaces in .NET
What I'm trying to do is to validate XML against an XSD. This is all pretty straightforward, but I'm having a problem with XML's without a namespace.
C# only validates the xml if the namespace matches the targetnamespace of the XSD. This seems…

JeanD
- 523
- 2
- 6
- 13
6
votes
2 answers
The prefix "xs" for element "xs:schema" is not bound
Following is the xsd that i am trying to use while generating a client for SOAP Service, Eclipse is throwing an error : The prefix "xs" for element "xs:schema" is not bound.

Aditya
- 181
- 1
- 2
- 10
5
votes
1 answer
xsd:simpleType: Can xsd:pattern and xsd:maxLength work together?
Let's say I am dealing with an xsd:simpleType that is a string, needs to be of a certain character set and of a specific maximum length, similar to the below code:
…

ecbrodie
- 11,246
- 21
- 71
- 120
5
votes
0 answers
Why does Edge change encoding ="UTF-8" to encoding ISO-8859-1
The browser Edge of its own volition converts an XSD file from encoding"UTF-8" to ISO-8859-1.
My questions are 1. Is this an EDGE peculiarity,or is EDGE doing it because UTF-8 was deprecated when I was not looking, and replaced by ISO-8859-1. 2.…

H Dtr
- 51
- 1
- 4
5
votes
1 answer
Nesting XML elements from different namespaces in XSD
Assume that I have an XML schema definition for elements of a namespace that I would like to use as child elements of XML elements within a second namespace.
As an example, suppose we have file foo.xsd:

jpvee
- 913
- 1
- 15
- 23