Questions tagged [xsd-1.0]

Use this tag when your XSD question pertains particularly to XSD 1.0, especially in cases where your XSD processor only supports XSD 1.0. Microsoft XML C# and .NET libraries, for example, only support XSD 1.0.

XML Schema version 1.0

This tag signals that your XSD question requires solutions limited to XSD 1.0; it is especially useful in cases where your XSD processor has not been updated to support features of XSD 1.1 such as Assertions (xsd:assert) and Conditional Type Assignment.

Note that Microsoft technologies in particular have not been updated to support XSD 1.1, so XSD questions tied to C# and .NET can use this tag to indicate that XSD 1.1 solutions are unacceptable.

References:

80 questions
8
votes
1 answer

XML Schema for a fixed element with a fixed attribute?

What would be the correct XML Schema 1.0 declaration for a Banana banana banana where: The xml:lang attribute is compulsory The value "en" is fixed and compulsory The content of notice is simple text. The content of…
Sean B. Durkin
  • 12,659
  • 1
  • 36
  • 65
7
votes
1 answer

How to specify minimal value for fractionDigits restriction in XML Schema?

I have a following XML Schema: Is there any…
Martin Vrábel
  • 830
  • 1
  • 13
  • 36
6
votes
2 answers

Restrict XSD attribute value based on another attribute value

I have this in the XML: I have these two cases: For a Const element with Name="b" the Value must be one of 1, 2, 3 or 4. No other…
Erik
  • 894
  • 1
  • 8
  • 25
6
votes
1 answer

Is there an alternative to in XML Schema 1.0

I have a XSD document fragment below. When an XML file validates against this schema I wish to ensure that the value in mm:Depot and mm:Customer/mm:County are the same and restricted to items in the Location type. This can be done in XML Schema…
cymorg
  • 534
  • 2
  • 10
  • 27
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

Limit number of occurences of an element based on an attribute value

I have an XML that looks like this: ... ... I am looking for a way to enforce that the number of Artifact elements contained in Artifacts shall be…
Vag
  • 305
  • 3
  • 11
4
votes
3 answers

XML Schema to restrict one field based on another

I have the following schema, which I use to ensure that a person's PhoneNumber and PhoneNumberType (Home, Work, etc.) is not longer than 10 characters. However, I want to improve this schema so that PhoneNumberType is not required if a PhoneNumber…
Kevin Albrecht
  • 6,974
  • 7
  • 44
  • 56
4
votes
1 answer

Restrict element of type in other namespace

I think what I need to do it's not possible with XSD 1.0, but anyway I'll ask... I have a complexType in a file, say a.xsd. In principle, I cannot touch this file. In particular, I cannot change its targetNamespace. An example would…
J C Gonzalez
  • 861
  • 10
  • 23
3
votes
1 answer

What XPath expression should I use in xs:field to select element content?

I am aware that in general one uses /the/path/to/a/node/text() to extract a string value. That has not been sufficient to solve my problem. I am using XML Schema version 1.0 to define some document types. I am trying to create a very simple keywords…
William Rosenbloom
  • 2,506
  • 1
  • 14
  • 37
3
votes
1 answer

inside an XSD 1.0 workarounds?

In my Java (Maven) project I'm using JAXB 2.2.11 to rebuild instances of a class from an XML payload received by our servers. I have an .xsd schema defining the class, which works great in conjunction with JAXB to rebuild an instance of the type I…
Savir
  • 17,568
  • 15
  • 82
  • 136
3
votes
1 answer

XSD schema with unordered required, optional and arbitrary tags

I am trying to come up with a XSD 1.0 schema with the following constraints: There is no ordering Some elements must appear exactly once Some elements may appear zero or unbounded times Allow unrecognized elements (do not validate them) The reason…
Theo
  • 43
  • 2
3
votes
1 answer

XSD unique element XPath limitations

In order to allow an element to appear multiple times but restrict it to element values only being allowed once, I'm applying the unique element. I've only got it working in an inefficient manner due to the XPath limitations within XSD 1.0 though.…
Forage
  • 2,726
  • 2
  • 18
  • 20
3
votes
2 answers

Different sub-elements depending on attribute/element value

Another XSD question - how can I achieve that the following XML elements are both valid: 1 ... 2 ... The sub-elements (either or )…
AndiDog
  • 68,631
  • 21
  • 159
  • 205
3
votes
1 answer

XSD - unique values of two different attributes

It is possible at schema level to enforce unique values of two attributes with different name?
sanjuro
  • 1,611
  • 1
  • 21
  • 29
3
votes
1 answer

What is the typical maximum length of values of the XML/XSD ID/IDREF types?

The W3C XSD 1.0 Part 2: Datatypes specification refers to the W3C XML 1.0 specification for the definition of the ID and IDREF types, but none of these documents defines any constraints on the length of values of these types. However, it seems that…
Andreas Maier
  • 2,724
  • 1
  • 26
  • 30
1
2 3 4 5 6