Questions tagged [xml-validation]

the procedure of checking an XML document against some kind of schema that describes rules that this type of document must conform to. This can often be done programmatically in eg. Java or C# and the schemas are often of the type XSD.

XML validation is the procedure of checking an XML document against some kind of schema that describes rules that this type of document must conform to. This can often be done programmatically in eg. Java or C# and the schemas are often of the type XSD.

1005 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
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
50
votes
3 answers

XML Validation error : EntityRef: expecting';'

http://www.ezed.in/ezed/courseDemoIntroPage.do?courseId=COU10000000138003530&checkingCourseFrom=preLogin#.U2DcKvmSySo error on line 102 at column 103: EntityRef: expecting';' Not able to figure out what could be the…
user99322
  • 1,157
  • 2
  • 15
  • 26
49
votes
3 answers

XML XSD Schema - Enforce Unique Attribute Values in Schema

Lets say I have a schema that defines the following XML: Value 1 Value 2 Value 3 Value 4 I would like, at a schema level, to…
MrEyes
  • 13,059
  • 10
  • 48
  • 68
48
votes
5 answers

cvc-elt.1: Cannot find the declaration of element 'MyElement'

I'm trying to validate a really simple xml using xsd, but for some reason I get this error. I'll really appreciate if someone can explain me why. XML File A XSD File
Mitko Mitev
  • 483
  • 1
  • 4
  • 7
45
votes
3 answers

XML validation with XSD: how to avoid caring about the sequence of the elements?

I have following XSD code:
jcborges
  • 1,064
  • 2
  • 10
  • 13
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
35
votes
4 answers

XML Schema Validation : Cannot find the declaration of element

I am still a bit new to XML Schema etc. and have been working to develop some XML, Schema and a Stylesheet (XSLT). I have made reasonable progress, but then realized that my Schema had stopped working, so I have taken it back to a simpler…
Nerdio
  • 983
  • 2
  • 11
  • 18
34
votes
5 answers

Validating XML with XSDs ... but still allow extensibility

Maybe it's me, but it appears that if you have an XSD
CaffGeek
  • 21,856
  • 17
  • 100
  • 184
30
votes
4 answers

How to parse invalid (bad / not well-formed) XML?

Currently, I'm working on a feature that involves parsing XML that we receive from another product. I decided to run some tests against some actual customer data, and it looks like the other product is allowing input from users that should be…
jvhashe
  • 1,071
  • 2
  • 12
  • 15
29
votes
2 answers

How to fix error: The markup in the document following the root element must be well-formed

I put my code in the XML validation website and it gives me this error: Line 8: 4 The markup in the document following the root element must be well-formed. The line that is having an issue is the
Mereinid
  • 295
  • 1
  • 3
  • 5
23
votes
1 answer

Is it possible to ignore namespaces in c# when using xPath?

I could be given either of the following xml: A vid with Pete Petes vid
Exitos
  • 29,230
  • 38
  • 123
  • 178
21
votes
2 answers

XML Validation: "No Child Element Is Expected At This Point"

I'm trying to develop an XSD grammar according to a given XML file. The given XML file itemList.xml is shown as below.
goldfrapp04
  • 2,326
  • 7
  • 34
  • 46
21
votes
2 answers

Validating XML against a schema (xsd) in NodeJS

Do any of the XML libraries in NPM support the validation of XML against an XSD schema? I would look myself, but: $ npm search xml 2>/dev/null | wc -l 212 Note: the xsd package is not what it seems and node-xerces is broken/empty.
fadedbee
  • 42,671
  • 44
  • 178
  • 308
1
2 3
66 67