Questions tagged [xsd-validation]

XSD validations are used to validate the XML file against the stored schema.

1640 questions
109
votes
6 answers

What does elementFormDefault do in XSD?

What does elementFormDefault do, and when should it be used? So I found some definitions for elementFormDefault values: qualified - elements and attributes are in the targetNamespace of the schema unqualified - elements and attributes do not…
Levi
  • 12,214
  • 14
  • 43
  • 47
105
votes
5 answers

XML Validation with XSD in Visual Studio IDE

I know I have done this before, but it isn't working today, nor can I find anywhere that explains how to do it. It could be my lack of sleep, but I suspect gremlins. I have an XML document and a directory full of XSD's that define it. How do I…
Jim McKeeth
  • 38,225
  • 23
  • 120
  • 194
94
votes
6 answers

Difference between and in schema definition?

I am using xsd:all in a complex type. When I miss any mandatory elements while validating it will show all the elements. It will not display the exact missed element. But if I am use xsd:sequence I can get the exact missed element. Is there any…
user1679378
  • 1,370
  • 3
  • 17
  • 23
86
votes
2 answers

xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?

For the following XML fragment:
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
43
votes
2 answers

What is the difference between xsd and xsi?

What exactly is the difference between XML Schema Document and XML Schema Instance ? xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Please elaborate.
Piyush
  • 599
  • 1
  • 7
  • 16
30
votes
3 answers

xml schema validation error "prefix is not bound"

I am entirely new to XML Schema and am trying to get the basics down. Here is my xml schema code (filename: example1.xsd):
lorenzoid
  • 1,812
  • 10
  • 33
  • 51
25
votes
1 answer

xsd choice for multiple elements

I would like my Xml file to look like the following a 23 or b ase is it possible to create a XML schema for the above using a…
Pradeep Achar
  • 363
  • 1
  • 3
  • 7
21
votes
3 answers

Does JAXB support xsd:restriction?

So I want it to get converted to Java…
Narendra Pathai
  • 41,187
  • 18
  • 82
  • 120
20
votes
2 answers

How to use xmllint to validate an XML document with an XSD?

I'm trying to use xmllint to check my work while developing a basic XSD i.e. XML Schema schema. However it's giving me an error Validation failed: no DTD found. What am I doing wrong? My xmllint command: xmllint --noout --valid --schema simple.xsd…
Tristan
  • 1,730
  • 3
  • 20
  • 25
18
votes
3 answers

stax xml validation

I know I can validate xml-file when I use sax. But can I validate when I use Stax?
Tim
  • 440
  • 1
  • 5
  • 12
17
votes
3 answers

XMLSchema validation on Android

I maintain the JDOM project and I am trying to 'certify' it on Android. Most things work fine, but XML Schema validation is proving problematic... My questions are: Is there a way to do XMLSchema validation on Android? If there is, how? Questions…
rolfl
  • 17,539
  • 7
  • 42
  • 76
15
votes
2 answers

Ignoring supplied namespaces when validating XML with XSD

Background: We're building an application that allows our customers to supply data in a predefined (ie. we don't control) XML format. The XSD is supplied to us by a Third Party, and we are expecting to receive an XML file that passes schema…
Martin
  • 2,180
  • 4
  • 21
  • 41
15
votes
2 answers

XSD: Cannot resolve the name 'type' to a(n) 'type definition' component

I am defining the schema but on validating it in eclipse it gives following error. src-resolve: Cannot resolve the name 'common:Name' to a(n) 'type definition' component. My schema looks like following:
Bagira
  • 2,149
  • 4
  • 26
  • 55
13
votes
1 answer
13
votes
1 answer

XML Schema 1.1 not recognizing 'assert' or 'assertion'

I am trying to use the following in an XSD
user2197116
  • 667
  • 3
  • 8
  • 21
1
2 3
99 100