Questions tagged [xsd-validation]

XSD validations are used to validate the XML file against the stored schema.

1640 questions
4
votes
1 answer

Write a comment in XSD that will appear in auto-generated XML?

How can I write a comment in XML schema as below and that needs to be displayed in XML when we generate XML from XML Schema using Oxygen XML editor. < THIS is a request for BUSINESS > Above is displayed in comment tag
srinathshil
  • 93
  • 1
  • 2
  • 11
4
votes
1 answer

Require XML element in XSD when another element has certain value?

I need a required attribute or element only if a specific value of an enumeration is chosen. Example below:
elnapo
  • 55
  • 2
  • 7
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
1 answer

Difference between lexical vs canonical representation in XSD spec

I was referencing the XSD spec today looking up the definition of a decimal type. In it, I found two different conflicting definitions of the datatype, a lexical definition and a canonical definition quoted below: 3.2.3.1 Lexical…
Russ
  • 1,996
  • 3
  • 19
  • 31
4
votes
1 answer

XSD assert not recognised

I have an XSD where I want to use an xs:assert statement. The issue is I don't know how to make the assert functionality available to me. I am using Visual Studio to write it, and it gets a blue line saying it doesn't support the assert element. My…
Tobias
  • 67
  • 1
  • 2
  • 6
4
votes
0 answers

Validating Xml against an xml schema in C# from a Portable Class Library

I need to validate XML stored in a custom format (not an XmlDocument or XDocument) in a C# portable class library. The System.Xml.Schema.XmlSchemaValidator class looks like it would fit the bill since it does not rely on a particular format - the…
bright
  • 4,700
  • 1
  • 34
  • 59
4
votes
1 answer

xsd validation complains about missing attribute and wrong attribute at the same time

I get somewhat schizophrenic behavior from xsd validation. This link shows the xml and xsd + the errors in an online schema validator. When I run this locally with xmllint xmllint --noout --nonet --schema devhelp2.xsd tester.devhelp2 I get similar…
ensonic
  • 3,304
  • 20
  • 31
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
2 answers

Multiple Xsd schemas in 1 file

I have multiple Xsd schema files (small ones) and would like to somehow combine them into 1 big file, I was thinking of an xml file with 1 node for each Xsd schema content, in the C# code selecting the corresponding section and validating against…
aly
  • 373
  • 2
  • 7
  • 22
4
votes
2 answers

Commons XMLConfiguration and schema validation?

I using Apache Commons XMLConfiguration for my configuration. Now I need a schema based validation. But I have problems to add my xsd to the XMLConfiguration. The xsd is locateded in the application jar file. If I use methods from Java SE the…
user3612610
  • 233
  • 4
  • 18
4
votes
1 answer

Allow only certain string at XML tag with XSD

I search for a way to check with my xsd that, a certain tag only one of different allowed strings contains. E.g. two allowed strings are: Index Condition OK: Index Condition WRONG: Integer The definition…
dot
  • 486
  • 1
  • 8
  • 17
4
votes
2 answers

JAXB - XSD validation on unmarshal do not fail on missing attribute

I have a problem with the unmarshal method and the validation of anattribute. I have an attribute that is set as "fixed" in my XSD and when I tried to unmarshal a XML which does not contain this fixed attribute, no error is raised. For me, the XML…
dor47
  • 81
  • 7
4
votes
2 answers

What do the attributes 'final' and 'block' mean in XSD?

In XSD, < complextType > can have the attributes 'block' and 'final', which can take a value of #all or a list of extensions or restrictions. What do these attributes mean? How do we use them? I could not get a clear answer from the W3C…
Chong Lip Phang
  • 8,755
  • 5
  • 65
  • 100
4
votes
2 answers

Nested choice element in XML Schema?

What I'm trying to do is, declare an parent element called "data", which are having 6 sub element of these two element are conditional that means if element A is choose then B is not appear in "data". Like this: text1
Chauhan
  • 71
  • 1
  • 5
4
votes
2 answers

When validate XSD against XML getting an error?

I'm trying to validate XSD aginst XML but getting an error The element 'Table' has incomplete content. List of possible elements expected: 'IP21TAG'. XML: VMD65-12-392
user2148679
  • 459
  • 1
  • 6
  • 18