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

XSD "version" attribute semantics

The XSD specification https://www.w3.org/TR/xmlschema11-1/#declare-schema does not specify the semantics for the version attribute: The other attributes (id and version) are for…
xarx
  • 627
  • 1
  • 11
  • 27
4
votes
2 answers

Is it possible to autogenerate XSD from Java object?

I need to generate XSD file as descriptor of standard. Is it possible to autogenerate XSD from Java object? Of course automated util cannot make complete and fulyl accurate XSD file, but it woild be helpful. So is there any Java libraries for this…
newbie
  • 24,286
  • 80
  • 201
  • 301
4
votes
2 answers

XSD - Child elements depending on attribute value

I am trying to create an XSD schema for the following XML: 100 200
user54639
4
votes
0 answers

Full URL of xsd schemaLocation in WSDL on WSO2 ESB EI

I've created a proxy service on WSO2 and the publish wsdl has references to some XSD files in the registry. The WSDL is opening fine, but the referenced XSD files are using relative path. I'd like them to be with full url. Cheking the documentation…
4
votes
2 answers

LINQ to XSD in VS 2010

how do I use Linq to XSD in VS2010. The last I know is to Install LINQtoXSD in VS2008 . Are there any updated in VS2010?.
Greens
  • 3,061
  • 11
  • 43
  • 61
4
votes
1 answer

How can I reuse a complex type in XSD for multiple elements?

I have been entirely unable to find any information on this, possibly due to me not having the terminology down. What I want to do is create a template element for currency, which I already have, and use it in two places under two different names…
Arran
  • 147
  • 1
  • 2
  • 11
4
votes
2 answers

xml schema check that restriction enumeration value only occrus once

I am creating a xsd schema for validation of some xml I would like to restrict the xml so it's not posible to input the same item twice: Bank Bank But it must be posible to use 2…
FLY
  • 2,379
  • 5
  • 29
  • 40
4
votes
1 answer

No character data is allowed by content model - XSD

Trying to validate a small xml I get the following error: no character data is allowed by content model. This is my example xml:
Daniel Garcia
  • 87
  • 1
  • 8
4
votes
1 answer

How can I describe a reference in a node to another one?

I have an XML format I need to parse. An example file is listed below:
guerda
  • 23,388
  • 27
  • 97
  • 146
4
votes
1 answer

How to make maven-jaxb2-plugin to ignore generating class if it is already exist in my project source

I am using maven jaxb2 plugin to generate java classes from xsd.I have a requirement that it should not generate the class if class already exist in my source. Is there anyway can we configure to ignore the pojo generation if it is already…
chandra
  • 41
  • 4
4
votes
0 answers

XSD to JSON schema dynamic conversion JAVA

I have xsd schema and I need to provide json schema. I saw that it is possible using JAXB and Jackson, but the main issue is that I need to generate class from xsd and only than I can generate json schema. My goal is to create webservice…
Lukas Ignatavičius
  • 3,496
  • 2
  • 24
  • 29
4
votes
2 answers

Checking a java value with an xml schema

is it possible to check a value in a java object with some rules in a xml schéma ? For exemple, I have a String txt = "blablabla", and I should verify if it's ok for , with string32 a restriction to 32 caract.…
Istao
  • 7,425
  • 6
  • 32
  • 39
4
votes
0 answers

formatting xsd validation message in java

when an xml is validated against a XSD schema using javax.xml.validation.Validator class following type of error messages are displayed. cvc-complex-type.2.4.a: Invalid content was found starting with element 'LastName'. One of '{FirstName}' is…
springenthusiast
  • 403
  • 1
  • 8
  • 30
4
votes
1 answer

Is there a way to pass a variable in schematron?

I want to use a variable to represent my schematron assertion and use it in my validation message. For example: User: '----' doesn't exist as a…