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.

Filter by
Sorted by
Tagged with
363 votes
11 answers
468k views

How to generate .NET 4.0 classes from xsd?

What are the options to generate .NET 4.0 c# classes (entities) from an xsd file, using Visual Studio 2010?
Bastien Vandamme's user avatar
287 votes
13 answers
345k views

How to validate an XML file against an XSD file?

I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
Jeff's user avatar
  • 3,252
285 votes
9 answers
263k views

Generate C# class from XML

Can I generate a C# class from an XML file?
user496949's user avatar
  • 84.8k
275 votes
14 answers
302k views

XML Schema (XSD) validation tool? [closed]

At the office we are currently writing an application that will generate XML files against a schema that we were given. We have the schema in an .XSD file. Are there tool or libraries that we can ...
Jason Dagit's user avatar
  • 13.8k
272 votes
21 answers
84k views

XML attribute vs XML element

At work we are being asked to create XML files to pass data to another offline application that will then create a second XML file to pass back in order to update some of our data. During the process ...
Jacob Schoen's user avatar
  • 14.1k
250 votes
3 answers
311k views

XML Schema minOccurs / maxOccurs default values

I'm wondering how the XML Schema specification handles these cases: <xsd:element minOccurs="1" name="asdf"/> No maxOccurs given -> Is this the cardinality [1..1]? <xsd:element minOccurs="5"...
Chris's user avatar
  • 9,389
231 votes
6 answers
167k views

What's the difference between xsd:include and xsd:import?

What's the difference between xsd:include and xsd:import? When would you use one instead of the other, and when might it not matter?
Pops's user avatar
  • 30.5k
214 votes
8 answers
267k views

What is the difference between XSD and WSDL?

What is the difference between an XML Schema and WSDL? The difference I noticed is that WSDL contains XSD and in WSDL we can declare operations, but not in XSD. Is that correct?
205 votes
19 answers
277k views

How to generate sample XML documents from their DTD or XSD?

We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ...
lindelof's user avatar
  • 35k
174 votes
5 answers
271k views

Validating an XML against referenced XSD in C#

I have an XML file with a specified schema location such as this: xsi:schemaLocation="someurl ..\localSchemaPath.xsd" I want to validate in C#. Visual Studio, when I open the file, validates it ...
jfclavette's user avatar
  • 3,467
154 votes
15 answers
237k views

How to visualize an XML schema programatically? [closed]

I have made an XML Schema - all the code basically - and was wondering if there is a way that the code can generate something like this: If so how can I do it?
matt's user avatar
  • 1,611
154 votes
3 answers
104k views

XML Schema: Element with attributes containing only text?

I'm having difficulty searching for this. How would I define an element in an XML schema file for XML that looks like this: <option value="test">sometext</option> I can't figure out how ...
Wilco's user avatar
  • 33k
153 votes
10 answers
203k views

Any tools to generate an XSD schema from an XML instance document? [closed]

I am looking for a tool which will take an XML instance document and output a corresponding XSD schema. I certainly recognize that the generated XSD schema will be limited when compared to creating a ...
Matt Dillard's user avatar
  • 14.8k
150 votes
2 answers
398k views

Using Notepad++ to validate XML against an XSD

Can someone explain how to use Notepad++ to validate an xml file against an xsd. There are no options in the "XML Tools" plugin dropdown that provides for specifying an XSD file. The XML plugin is ...
user2174533's user avatar
  • 1,503
148 votes
11 answers
378k views

Generate Java classes from .XSD files...?

I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that I can send/receive from QuickBooks. I'd like to be able to easily generate Java classes from these .XSD ...
Keith Palmer Jr.'s user avatar
143 votes
4 answers
158k views

what is the use of xsi:schemaLocation?

I see that we have multiple url's as value of this attribute like in spring: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:...
sab's user avatar
  • 9,857
141 votes
8 answers
168k views

Validating with an XML schema in Python

I have an XML file and an XML schema in another file and I'd like to validate that my XML file adheres to the schema. How do I do this in Python? I'd prefer something using the standard library, but ...
Eli Courtwright's user avatar
131 votes
2 answers
180k views

How to make an element in XML schema optional?

So I got this XML schema: <?xml version="1.0"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:...
Richard Knop's user avatar
  • 82.4k
131 votes
7 answers
45k views

XML schema or DTD for logback.xml?

I've seen several discussions on the net about how great it would be to have an XML schema or DTD for logback.xml file to have at least the very basic validation and auto-completion in IDEs like IDEA ...
Vladislav Rastrusny's user avatar
128 votes
3 answers
119k views

XSD: What is the difference between xs:integer and xs:int?

I have started to create XSD and found in couple of examples for xs:integer and xs:int. What is the difference between xs:integer and xs:int? When I should use xs:integer? When I should use xs:int?
Michael's user avatar
  • 10.2k
123 votes
7 answers
127k views

XSD - how to allow elements in any order any number of times?

I am trying to create an XSD, and trying to write the definition with the following requirement: Allow child element specified to appear any number of times (0 to unbounded) Allow child elements to ...
jvtech's user avatar
  • 1,389
122 votes
7 answers
158k views

What is the difference between XML and XSD?

What is the difference between Extensible Markup Language (XML) and XML Schema Definition (XSD)?
Gandalf StormCrow's user avatar
110 votes
6 answers
127k views

What does elementFormDefault do in XSD?

What does elementFormDefault do, and when should it be used? So I found some definitions for elementFormDefault values: qualified - elements and attributes are in the targetNamespace of the ...
Levi's user avatar
  • 12.3k
109 votes
4 answers
97k views

What is an xs:NCName type and when should it be used?

I ran one of my xml files through a schema generator and everything generated was what was expected, with the exception of one node: <xs:element name="office" type="xs:NCName"/> What exactly ...
user avatar
107 votes
5 answers
108k views

XML Validation with XSD in Visual Studio IDE

I know I have done this before, but it isn't working today, nor can I find anywhere that explains how to do it. It could be my lack of sleep, but I suspect gremlins. I have an XML document and a ...
Jim McKeeth's user avatar
  • 38.5k
107 votes
18 answers
175k views

Spring schemaLocation fails when there is no internet connection

I am using Spring and in application-context.xml I have the following definitions: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:...
Altug's user avatar
  • 1,733
104 votes
6 answers
62k views

YAML Schema Validation?

Is there a schema validation language for YAML? I've googled but couldn't find anything useful. Something like XSD format, using the language itself to describe the schema, would be the best choice ...
Klaim's user avatar
  • 68.4k
99 votes
1 answer
2k views

Required tags not present when using Delphi XML Data Binding Wizard

I am using the XML Data Binding Wizard in Delphi XE2. The schema has required tags of this type: <xs:element name="MyReport" type="MyReportType" /> <xs:complexType name="MyReportType"> &...
Randomeister's user avatar
  • 1,125
97 votes
3 answers
72k views

Difference between xs and xsd in XML schema file?

What is the difference between the xs and xsd prefixes in XML schema files?
user avatar
95 votes
10 answers
200k views

What is the purpose of XSD files?

Since we can query on the XML file from C# (.NET), why do we need an XSD file? I know it is metadata file of particular XML file. We can specify the relationships in XSD, but what is its functioning ...
Red Swan's user avatar
  • 15.4k
95 votes
6 answers
127k views

Difference between <xsd:all> and <xsd:sequence> in schema definition?

I am using xsd:all in a complex type. When I miss any mandatory elements while validating it will show all the elements. It will not display the exact missed element. But if I am use xsd:sequence I ...
user1679378's user avatar
  • 1,380
94 votes
9 answers
134k views

How can I tell jaxb / Maven to generate multiple schema packages?

Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> &...
M.R.'s user avatar
  • 1,959
92 votes
2 answers
81k views

xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?

For the following XML fragment: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache....
smwikipedia's user avatar
  • 63.2k
91 votes
13 answers
79k views

Is there any difference between 'valid xml' and 'well formed xml'?

I wasn't aware of a difference, but a coworker says there is, although he can't back it up. What's the difference if any?
user18931's user avatar
  • 10.9k
91 votes
3 answers
119k views

XML Schema How to Restrict Attribute by Enumeration

I have the following XML Tag <price currency="euros">20000.00</price> How do I restrict the currency attribute to one the following: euros pounds dollars AND the price to a double? I ...
Luke's user avatar
  • 23.3k
87 votes
15 answers
121k views

Remove 'standalone="yes"' from generated XML

Do you know of a JAXB setting to prevent standalone="yes" from being generated in the resulting XML? <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Johan Pelgrim's user avatar
87 votes
20 answers
68k views

How to use jQuery for XML parsing with namespaces

I'm new to jQuery and would like to parse an XML document. I'm able to parse regular XML with the default namespaces but with XML such as: <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" ...
Brian Liang's user avatar
  • 7,764
83 votes
6 answers
84k views

targetNamespace and xmlns without prefix, what is the difference?

In an xml schema document, if I have both the targetNamespace and the xmlns without a prefix. <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example....
Abe's user avatar
  • 8,841
82 votes
11 answers
75k views

Fix: The Global element 'configuration' has already been declared

I used the second solution of How to resolve "Could not find schema information for the element/attribute <xxx>"? I.e. created a XSD with the button to create a scheme. I changed the ...
Michel Keijzers's user avatar
82 votes
5 answers
147k views

Generate Json schema from XML schema (XSD) [closed]

Does anybody know how to generate a JSON schema from a existing XML schema (XSD file)? Are there any tools available for this?
JB Hurteaux's user avatar
  • 4,488
78 votes
10 answers
23k views

What are XML namespaces for?

This is something that I always find a bit hard to explain to others: Why do XML namespaces exist? When should we use them and when should we not? What are the common pitfalls when working with ...
Doron Yaacoby's user avatar
76 votes
2 answers
47k views

What are the best practices for versioning XML schemas?

I often have to design XML schemas for different XML-bases import routines. It is clear that XML schemas will evolve over time or they could contain bugs to be fixed, so it is important to capture the ...
Regent's user avatar
  • 5,562
76 votes
7 answers
60k views

Comparison of XSD Code Generators [closed]

I'm doing some research in code generation from xsd schema files. My requirements: Must generate C# 2.0 code (or above), using generic collections where needed. Must generate comments from the xsd ...
edosoft's user avatar
  • 17.2k
75 votes
5 answers
70k views

Why is it called nillable?

In an XML schema you can mark an element as nillable meaning it can take an explicit NULL value. See nillable and minOccurs XSD element attributes for a great explanation. What I'm curious about is ...
RB.'s user avatar
  • 36.7k
73 votes
3 answers
124k views

Use of Greater Than Symbol in XML

I had created the xml document with xml version="1.0". In that document I need to use the greater than symbol > and less than symbol <. How should I include those symbols? It's not working. &...
praveenjayapal's user avatar
73 votes
7 answers
80k views

JAXB - Property "Value" is already defined. Use <jaxb:property> to resolve this conflict

Using JAXB to generate XML binding classes. The schema is based on a set of legacy XML files, and includes this snippet: <xs:complexType name="MetaType"> <xs:simpleContent> &...
brasskazoo's user avatar
  • 77.4k
70 votes
2 answers
64k views

Add attributes to a simpletype or restriction to a complextype in Xml Schema

The problem is as follows: I have the following XML snippet: <time format="minutes">11:60</time> The problem is that I can't add both the attribute and the restriction at the same time. ...
Ikke's user avatar
  • 100k
70 votes
2 answers
111k views

XSD Definition for Enumerated Value

I'm stuck trying to define an XSD containing a field that can have only one of the following three values: Green Red Blue Essentially, I want to define a strict enumeration at the Schema level. My ...
Nate's user avatar
  • 19.1k
69 votes
1 answer
74k views

how to Validate a XML file with XSD through xmllint [duplicate]

i have to validate my xml file with a given XSD file. Figured the easiest way to do so would be xmllint, but i can't get it to work. Can anyone tell me the exact command? I tried: xmllint --...
Econ's user avatar
  • 2,629
69 votes
5 answers
33k views

XSD - one of 2 attributes is required?

Is there a way to specify that one of 2 attributes is required in XSD? for example, I have a definition like this: <xs:attribute name="Name" type="xs:string" use="optional" /> <xs:attribute ...
user92454's user avatar
  • 1,201

1
2 3 4 5
285