Questions tagged [xmlschema]

XML Schema is a XML-based description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, beyond the basic syntactical constraints imposed by XML itself. Questions should use xmlschema tag for questions related to XML Schema or schema-related tools. Use xsd tag for the XML Schema Definition language.

XML Schema describes the structure of an XML document with the XML Schema language, which is also referred to as XML Schema Definition (XSD).

XML Schema builds on the basic concepts in XML 1.0 and Namespaces. XML defines content with elements and attributes, and XML Schema defines which elements and attributes as well as in which order they may appear and other constraints in a particular class of XML instances.

In XML Schema, there is a basic difference between complex types which allow elements in their content and may carry attributes, and simple types which cannot have element content and cannot carry attributes (e.g., integers, strings, etc.).

See Also:

59 questions
1
vote
1 answer

Fail to use xmlschema.from_json

I had being look for the answer left and right. Even stackoverflow only has 1 similar question, but the answer does not work in my case. I fail to validate the xml and keep getting this error: "unable to select an element for decoding data, provide…
user2418216
  • 141
  • 1
  • 10
1
vote
0 answers

XML Schema where child element type depends on parent attribute value

Is it possible to write an XSD schema for XML where all node names has the same name and can only be identified by an attribute value? A sample XML data: John Doe
Gilmor
  • 439
  • 1
  • 3
  • 11
1
vote
1 answer

Can I use XML Schema to validate documents with no xmlns attribute?

I have a situation where I'd like to start using an XML Schema to validate documents that, until now, have never had a schema definition. As such, the existing documents I'd like to validate do not have any xmlns declaration in them. I have no…
Christopher Schultz
  • 20,221
  • 9
  • 60
  • 77
1
vote
2 answers

Extract enumerations with documentation from XSD file in Python

I'm trying to write a function to get the description of some values from a XSD file, with a structure like this
AlmuHS
  • 387
  • 6
  • 13
1
vote
1 answer

Reusable simpleType definition in SQL Server schema collection

I'm trying to create a reusable simpleType in an SQL Server XML schema collection but I'm getting an error. For example:
JHJ
  • 303
  • 1
  • 6
1
vote
1 answer

Is there an equivalent to DTD or XML Schema for JSON and YAML?

DTD and XML Schema are often used to define tags and attributes the should be used to properly write an XML files. Using them, it is thus possible to validate the content of XML files not just against the strict XML language syntax, but also looking…
Vito Gentile
  • 13,336
  • 9
  • 61
  • 96
1
vote
0 answers

Nested XML and XML - schema definition

I want to define the XML schema for an XML representation of shopping order data. See following requirements The XML representation of order should contain order id, description, request date, and many line item Each line item element should…
user8838577
1
vote
1 answer

Validating an XML against an XSD using Apache Camel

My aim is to read a CSV file, convert it to an XML and validate it against an XSD. Below is the code: CamelContext _ctx = new DefaultCamelContext(); _ctx.addRoutes(new RouteBuilder() { public void configure() throws Exception { …
sidd
  • 195
  • 3
  • 20
1
vote
0 answers

element as a child element from

I don't get it. What does this XSD mean exactly?:
Kaleun
  • 13
  • 3
0
votes
0 answers

XML Schema "maxOccurs"

I have a question about using "minOccurs" and "maxOccurs". when I insert "unbounded" in "maxOccurs", in which constructor element should be inserted "sequence"? In the root? Thanks I put "sequence" in the reference element.Is it wrong?
0
votes
1 answer

Ambiguous Content Model - Allowing Individual Elements or specific combinations but not all elements

Hopefully the schema here describes what I'm trying to do.
Jamie
  • 168
  • 10
0
votes
0 answers

How does XML phaser find the schema it can be use for validation?

This question was raised because I find the some:schema is referencing the documentation instead of a XML schema file. I have has read this question but it still doesn't answer my question. Doesn't the validation require DTD or schema to…
0
votes
1 answer

Validate a specific element of an unvalidated XmlDocument

I have legacy XML documents that contain nested (non-root) elements that I want to validate against an XML Schema. The schema itself does not describe the XML document as a whole, but only a particular nested element. The XML document resembles a…
Ondrej Tucny
  • 27,626
  • 6
  • 70
  • 90
0
votes
1 answer

XML schema's recursion of sequence of choices

I have been stumped on this problem. I'm trying to create a schema for xml with some complex recursion. I'll give an example:
0
votes
0 answers

Get Attribute from XML element

At the moment we are trying to get the Innertext from a XMLElement where the attribute is EAN. The only problem is that the XMLElements have the attribute name dt:dt, which can't be found. We have an XML Schema for this, but how can we import this…
mariodelta
  • 53
  • 6