Questions tagged [xsd]

XSD generally refers to a document written in the W3C XML Schema format, containing a description of a particular type of XML document.

XML Schema, published as a W3C recommendation in May 2001, is one of several XML schema languages.

Because of confusion between XML Schema as a specific W3C specification, and the use of the same term to describe schema languages in general, some parts of the user community referred to this language as WXS, an initialism for W3C XML Schema, while others referred to it as XSD, an initialism for XML Schema Document — a document written in the XML Schema language, typically containing the "xsd" XML namespace prefix and stored with the ".xsd" filename extension.

As of April 5th 2012, the XML Schema Definition (XSD) 1.1 is a W3C Recommendation; W3C has adopted XSD as the preferred acronym.

What is an XML Schema?

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.

An XML Schema:

  • defines elements that can appear in a document.
  • defines attributes that can appear in a document.
  • defines which elements are child elements.
  • defines the order of child elements.
  • defines the number of child elements.
  • defines whether an element is empty or can include text.
  • defines data types for elements and attributes.
  • defines default and fixed values for elements and attributes.

See also:

14065 questions
4
votes
1 answer

"Elements ... does not resolve to a(n) type definition" in validation

I am trying to create an XSD file to work as a filter to validate some XML files that will have to be processed further. Here is the XSL file:
AntonH
  • 6,359
  • 2
  • 30
  • 40
4
votes
1 answer

Attribute for XSD to prevent XSD.exe FieldSpecified flags

I have an xsd file that has the following definition below. When using xsd.exe to generate classes from the xsd file, the enum attrs get an additional FieldSpecified property as visible below. Unless the FieldSpecified property is set, the value…
QueueHammer
  • 10,515
  • 12
  • 67
  • 91
4
votes
2 answers

XSD maxLength and minLength applied to integer

I am having some trouble finding out how to tell the XSD that the data of a field has to have an minimum length of 12 digits and a maximum length of 14 digits. Is there someone who knows how to do this because minlength and maxlength can only be…
user3356007
  • 393
  • 1
  • 6
  • 20
4
votes
0 answers

How to extract properties and its data type from xsd file generically using c#?

I have two types of XSD file.Below are the two types of XSD Type 1
Mahek
  • 552
  • 2
  • 7
  • 28
4
votes
2 answers

How to validate an XSD schema with lxml, but ignore elements that match a given pattern?

One can use lxml to validate XML files against a given XSD schema. Is there a way to apply this validation in a less strict sense, ignoring all elements which contain special expressions? Consider the following example: Say, I have an…
flonk
  • 43
  • 1
  • 4
4
votes
2 answers

XML + XSD => Java?

I need to make the above equation comes true! I have an XML file with its XSD schema, and I need to get the Java classes with the required code to parse the XML file and construct java objects.. I am asking here about a standard (or defacto like…
Muhammad Hewedy
  • 29,102
  • 44
  • 127
  • 219
4
votes
4 answers

How to declare special XML schema (XSD) case

I need your help to define a special case in XML schema: A sequence that contains two elements: 'x' and 'y' whereas: element can appear 0 to unbound times in the sequence element can appear 0 to 1 time in the sequence and locations…
ogee
  • 917
  • 1
  • 6
  • 11
4
votes
1 answer

Using jax-ws-catalog.xml for resolving imported xsd:s in wsdl

I would like to deploy a Web Service using JAX-WS 2.1 on Weblogic where the wsdl imports a schema but I would prefer to have it in another location than together with the wsdl, preferrably it should be loaded from the classpath. I was hoping I could…
Olof Åkesson
  • 707
  • 9
  • 18
4
votes
1 answer

Setting minOccurs and maxOccurs in XSD based on value of other XML field?

I have an XSD to validate an XML file. The structure is as follows: 2 Element 1 Element 2 The number of…
SelketDaly
  • 539
  • 1
  • 5
  • 20
4
votes
0 answers

How to Configure Xerces-C++ to process XIncludes prior to XML Schema Validation

Consider an XML file, config.xml:
John
  • 1,037
  • 11
  • 19
4
votes
1 answer

JAXB: mapping namespace to package with maven plugin

Let's assume I have a.xsd file in resources/a directory and b.xsd file in resources/b directory. a.xsd and b.xsd have their own namespaces: http://a.com and http://b.com. And finally, a.xsd imports b.xsd. I'd like to configure maven-jaxb2-plugin to…
trzeci
  • 61
  • 1
  • 5
4
votes
1 answer

Spring Security : configuration error

I am not able to solve this problem that I have XSD version above 4 then why there is still conflict? I am using Spring JARs and all of them have version 4 or above and still getting error. Following is XSD for spring-security.xml:
user6601906
4
votes
1 answer

Why does xs:choice allow multiple different xs:element in the resulting xml?

I know about this related question and I understand that my question contradicts that answer, but the following XML file validates perfectly against the following XMLSchema my XML data:
Andrei
  • 961
  • 1
  • 9
  • 29
4
votes
1 answer

How do I force the auto-generated WSDL on two load-balanced machines to match?

We have a WCF service that is deployed to two servers. The bits are exactly the same. In the auto-generated WSDL at https://mywebsite.com/SomeService/Soap.svc?wsdl, the node lists out a bunch of XSD's, in this format:
Rohan Singh
  • 20,497
  • 1
  • 41
  • 48
4
votes
1 answer

Force use of CDATA in XML-schema

I am creating an xml schema, and I want to make sure that the values in all the elements are CDATA elements. Is there a way to force this using XML-schema?
Dana
  • 2,619
  • 5
  • 31
  • 45