Questions tagged [xsd-validation]

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

1640 questions
4
votes
2 answers

Validating XML against XSD using C#: Data at the root level is invalid. Line 1, position 1

I am trying to validate an XML file against a XSD Schema, and am encountering an XmlException, message Data at the root level is invalid. Line 1, position 1. Based on a crawl through previous similar posts I have done the following: Ensured that…
technorabble
  • 391
  • 7
  • 16
4
votes
1 answer

Local XML validation with DTD or XSD using a relative path?

An XML file can be defined and validated with an Document Type Description (DTD) or XML Schema (xsd) as follows:
eactor
  • 862
  • 3
  • 14
  • 34
4
votes
2 answers

What is the alternative to have xsd:sequence behavior inside a xsd:all?

I don't understand how I should define my complex type. Today I have this:
Natim
  • 17,274
  • 23
  • 92
  • 150
4
votes
1 answer

XSD Validation with If Else Possibility

Just trying to figure out if below scenario can be achieved through XSD schema level validation. E.g- This tag can have Values - Family or Single if I got the value as "Family", I should be having below xml…
user1884099
  • 41
  • 1
  • 2
4
votes
2 answers

Is there a way to combine semantics with semantics?

I have a document type similar to the following: true
Billy ONeal
  • 104,103
  • 58
  • 317
  • 552
4
votes
1 answer

How do you make an XSD element required or not required depending on the context?

We have a definition of Person element where we want different elements to be required depending on what they are doing. For example, if they are adding a Person, then different elements are required to be sent versus updating a Person. Below in…
tjg184
  • 4,508
  • 1
  • 27
  • 54
4
votes
1 answer

XSD custom type with attribute and restriction

I am developing an XSD document to validate XML Import files. Nearly all elements of the import file 'can' have an ID attribute (UPDATE). The UPDATE attribute must be limited to 4 possible values, so I have this pre-set type to use for the…
Cynthia Madison
  • 63
  • 1
  • 1
  • 5
4
votes
1 answer

Error in automatically generated XSD scheme: global element 'configuration' has already been declared

When automatically creating a scheme for app.config, an app.xsd is generated. However in the beginning fragment:
Michel Keijzers
  • 15,025
  • 28
  • 93
  • 119
3
votes
1 answer

XML validation issue

I am trying to validate an XML against an XSD using 'xmllint' command of Unix. The problem I am facing is this: In the XSD, the field "state" is specified as follows:
Bhushan
  • 18,329
  • 31
  • 104
  • 137
3
votes
3 answers

RelaxNG or XSD schema validation with JavaScript

I'd like to do RelaxNG (preferred) or XSD (if I have to) schema validation in client-side JavaScript. Any good libraries for this? Google finds jsrelaxngvalidator but I'm having trouble getting it running and it seems unmaintained. Target…
lambshaanxy
  • 22,552
  • 10
  • 68
  • 92
3
votes
2 answers

How expensive is a XSD validation of XML?

I want to validate large xml files by using xsd schemas in C#. For a file of 1000 lines of xml code validation takes a long time. Are there any tips and tricks to validate faster? Can you post some code examples that work faster with large xml…
radu florescu
  • 4,315
  • 10
  • 60
  • 92
3
votes
1 answer

XML targetNamespace and unqualified declaration of elements

I'm somewhat confused as to how the targetNamespace attribute in an XML schema affects the naming of elements. I'm getting an error validating the following:
holic87
  • 791
  • 2
  • 17
  • 29
3
votes
2 answers
3
votes
2 answers

Configure an XSD to consist of multiple xs:schemas?

I have an XSD file in which I would like to place several diagrams, with a description of the services. When adding
xay yec
  • 33
  • 3
3
votes
1 answer

Is XMLLint for Windows in active development?

I have a project to validate XML files according to XSD specs: It should run from Windows command line Validation errors should be saved to a file for later review XMLLint looks like the perfect candidate. It does all of the above. However, this…
PowerUser
  • 11,583
  • 20
  • 64
  • 98