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
2 answers

XSD Enumeration on a range of values

I've got to build an XSD file for XML structure verifying purposes, as usual. After generating the XSD (with XMLSpy), I've found one portion of the file that is giving me trouble. I've got an enumeration like this:
nrocha
  • 384
  • 1
  • 2
  • 9
4
votes
2 answers

XML Schema regex empty string

I have a XML Schema with a regex restriction that matches three different options and looks similar to this: somestring|someotherstring| Some string, or Some other string, or Empty string My problem is that xmllint does not like this regex. It…
d.breve
  • 127
  • 1
  • 12
4
votes
2 answers

Need to parse a xml string

I need to a parse an xml string(.NET, C#) which , unfortunately, is not well formed.. the xml stream that i am getting back is…
Gagan
  • 5,416
  • 13
  • 58
  • 86
4
votes
2 answers

XML Schema: how to have multiple identical elements?

I'm having quite a hard time on constructing my 1st XML Schema. I need it to verify the correctness of an XML document that forms a questionnaire. So here's the section in don't get: I changed the source. The 1st answer refers to this code:
stfn
  • 1,140
  • 5
  • 19
  • 33
4
votes
3 answers

Creating XML Schema for elements with the same name?

I am trying to create an XSD Schema for an XML document I have received however there are two elements staff which have the same name. Is there any way to create a schema for this XML even though there are two elements with the same…
Andrew Hoban
  • 43
  • 1
  • 4
4
votes
1 answer

The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "beans" is not bound

Why am I having this error [Fatal Error]: The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "beans" is not bound. at the header of my XML file:
Blaze
  • 2,269
  • 11
  • 40
  • 82
4
votes
1 answer

How to define an attribute in XSD whose type can change dynamically

I need to define an attribute called "DataValue" of an element "MyData". But the requirement is that the type of "DataValue" can change dynamically i.e., the data value could be string in one instance and in other instance it could be int or bool.…
Abi
  • 571
  • 1
  • 6
  • 8
4
votes
1 answer

Hyperjaxb: Exclude XML Element by XML property

I have a predefined XSD that looks as follows: ...
Erzen
  • 169
  • 10
4
votes
2 answers

How to get all the tags of basic data types from e-repository of iso20022?

How to get all the tags of basic data types [of xsd data types (like xs:byte, xs:date, xs:dateTime, xs:decimal, xs:double, xs:duration etc.) or iso20022 types (like iso20022:Amount, iso20022:Binary, iso20022:Date, iso20022:DateTime etc.)] of from…
AVA
  • 2,474
  • 2
  • 26
  • 41
4
votes
1 answer

validation error [ There is no ID/IDREF binding for IDREF ]

I am getting this error message when validating my XML file against its Schema. Can anyone suggest what might be wrong? The XML file is:
Madhu CM
  • 2,296
  • 6
  • 29
  • 38
4
votes
3 answers

Looking for an XSD representing an 'Order' for a shopping cart

I am trying to create an XML schema representing an 'order' for a shopping cart I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on…
Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
4
votes
2 answers

Representing a object list in XSD

I need to declare a list in my xsd file . Not sure what changes do I need to make. I tried using simple type but the required type is not getting generated. I need my pojo to have the datatype as - @XmlElement(name = "Journeys", required = true) …
themaster
  • 453
  • 11
  • 32
4
votes
1 answer

Write a comment in XSD that will appear in auto-generated XML?

How can I write a comment in XML schema as below and that needs to be displayed in XML when we generate XML from XML Schema using Oxygen XML editor. < THIS is a request for BUSINESS > Above is displayed in comment tag
srinathshil
  • 93
  • 1
  • 2
  • 11
4
votes
1 answer

Require XML element in XSD when another element has certain value?

I need a required attribute or element only if a specific value of an enumeration is chosen. Example below:
elnapo
  • 55
  • 2
  • 7
4
votes
2 answers

Programmatically convert an XSD 1.1 schema to XSD 1.0?

How can I convert an XSD 1.1 schema to an XSD 1.0 schema automatically by stripping out all the 1.1 features and leaving only the subset that is compatible with XSD 1.0? I realize that this would impose restrictions on how many XSD 1.1 features you…
ivanatpr
  • 1,862
  • 14
  • 18
1 2 3
99
100