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

How to change XmlType of generated JAXB classes

I am using gradle to generate Java classes based on an XML Schema file. I am using 'org.glassfish.jaxb:jaxb-xjc:2.2.11' and 'org.glassfish.jaxb:jaxb-runtime:2.2.11' as dependencies so I can use the 'com.sun.tools.xjc.XJC2Task' class to generate the…
npeder
  • 788
  • 10
  • 26
4
votes
1 answer

XSD Error: Type is not declared, or is not a simple type

For this explanation I am using 2 different XSDs: customEntry.xsd:
roadmaster
  • 593
  • 2
  • 9
  • 22
4
votes
2 answers

Validate an XSD using Java

I would like to automatically validate that an XSD Schema is correct. Is there a java API or something Í can call to do this automatically?
Dr. Simon Harrer
  • 1,954
  • 1
  • 15
  • 26
4
votes
1 answer

xsi:type attribute messing up C# XML deserialization

I used XSD.exe to automatically generate C# objects based on the XML schemas (.xsd files). I'm deserializing OpenCover output, but one of the partial classes didn't get generated correctly. Here's the line that's causing the exception:
Kieran Paddock
  • 375
  • 1
  • 5
  • 15
4
votes
1 answer

Restrict the depth of nested elements in XSD

Is it possible with XML schema to restrict the depth of child elements nested in a parent? The context here is I collect alarms from a management system and I want to provide a XML document which allows the end user define some rules in order to…
tja
  • 67
  • 4
  • 9
4
votes
3 answers

Extend XSD with custom attributes?

Is there a way to extend XSD elements with custom attributes? For example, I'd like to do the following in an XSD:
Jonathan Bailey
  • 306
  • 2
  • 13
4
votes
1 answer

Debatching Biztalk Flatfile Schema with nested repeating nodes

I have a flatfile with nested repeating nodes that needs needs to be debatched to single records. The flatfile: ABC DEF 1234.456789012345678 000000123456L01 Supplier 0 001000123456L01 00301Address 1 …
frummel
  • 53
  • 6
4
votes
3 answers

Automatic editor of XML (based on XSD scheme)

Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor).
Solvek
  • 5,158
  • 5
  • 41
  • 64
4
votes
1 answer

xsd.exe generates weird C# class for XML serialization

I have an XML schema in .xdr file. This is a shortened version of this file(just for example):
nan
  • 19,595
  • 7
  • 48
  • 80
4
votes
2 answers

Why should you use XML CDATA blocks?

When creating XML I'm wondering why the CDATA blocks are uses rather than just escaping the data. Is there something allowed in a CDATA block that can't be escaped and placed in a regular tag? instead…
Xeoncross
  • 55,620
  • 80
  • 262
  • 364
4
votes
1 answer

How to import an XML schema into the "no namespace"

I have a schema here where I am trying to include/import another schema that has no namespace (and this cannot be changed because it comes from another vendor and it would no longer validate their XML). Here is the first Schema:
Zombies
  • 25,039
  • 43
  • 140
  • 225
4
votes
1 answer

jackson fasterxml multiple elements with the same name

I need to generate XML that confirms to this XSD: So that the output is like: A B C The problem is that if I…
Hooli
  • 1,135
  • 3
  • 19
  • 46
4
votes
1 answer

Can´t deserialize xml-doc because of missing XSD-file

I have a class that I want to de-serialize an XML-doc into: [XmlRoot(ElementName = "MyType", Namespace = "MyNamespace")] public class MyClass : MyBase { } And [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd",…
MakePeaceGreatAgain
  • 35,491
  • 6
  • 60
  • 111
4
votes
2 answers

Default boolean value is not getting set in JAXB generated class

I am tying to generate class from xsd using JAXB and make use of default values in xsd. But when I set default value of a xs:boolean element to "true". The value is not set and I get the null-pointer exception as Boolean object value has not been…
Dhanesh Khurana
  • 159
  • 1
  • 13
4
votes
1 answer

How to stop backslashes being escaped when filtering with maven-resources-plugin?

I'd like to use the Maven Resources Plugin to set the XML schema location within an XML resource file: This works except for one thing - the substituted path has double backslashes instead…
Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
1 2 3
99
100