Questions tagged [xml-validation]

the procedure of checking an XML document against some kind of schema that describes rules that this type of document must conform to. This can often be done programmatically in eg. Java or C# and the schemas are often of the type XSD.

XML validation is the procedure of checking an XML document against some kind of schema that describes rules that this type of document must conform to. This can often be done programmatically in eg. Java or C# and the schemas are often of the type XSD.

1005 questions
19
votes
9 answers

What is an XML infoset and in what ways is it different to an XML document?

I've tried to read http://www.w3.org/TR/xml-infoset/ and the wikipedia entry. But frankly I'm still not sure what the difference is. The quote : An XML document has an information set if it is well-formed and satisfies the namespace…
Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
18
votes
2 answers

Validate JSON against XML Schema (XSD)

Is it possible to validate JSON with an XSD in Java? I have an application where I receive JSON response, and I would like to validate it against existing XSD. Another part of my application uses XML, which is why it would be easiest if they both…
user16655
  • 1,901
  • 6
  • 36
  • 60
18
votes
3 answers

Getting started with XSD validation with .NET

Here is my first attempt at validating XML with XSD. The XML file to be validated:
Nick Heiner
  • 119,074
  • 188
  • 476
  • 699
18
votes
3 answers

XML (.xsd) feed validation against a schema

I have a XML file and I have a XML schema. I want to validate the file against that schema and check if it adheres to that. I am using python but am open to any language for that matter if there is no such useful library in python. What would be my…
Scooby
  • 3,371
  • 8
  • 44
  • 84
15
votes
4 answers

Is there an xhtml.xsd equivalent available for HTML5?

I am developing an appplication based on Mozilla XULRunner. I am using the xhmtl1-strict.xsd provided by the W3C to fetch the attribute. Now the requirement came to add the
Abhishek Choudhary
  • 8,255
  • 19
  • 69
  • 128
15
votes
2 answers

XML Validation error: The element is not declared

I am building a web service in .NET that will pass data back and forth via XML. I would like to validate the XML in the incoming requests using an XSD that I have defined. Here is the XSD:
mac
  • 485
  • 1
  • 6
  • 29
15
votes
5 answers

Element cannot have character [children], because the type's content type is element-only

I tried validating my XML file with a XSD file but I get the following error message: [Error]: cvc-complex-type.2.3: Element 'paragraph' cannot have character [children], because the type's content type is element-only Which (if i am…
Toshan
  • 153
  • 1
  • 1
  • 5
15
votes
2 answers

Validate XML against XSD in pure ABAP

Is there there any standard way to perform validation of XML document using XSD in ABAP? As far as I know, there is an approach that utilizes XI/PI capabilities, but these are not available in our system. I think we might also use a workaround: make…
Nikolai Kim
  • 685
  • 8
  • 22
15
votes
1 answer

Server-Side XML Validation with CXF Webservice

I'm working on an Apache CXF webservice (using JAX-WS, over SOAP). The service itself is pretty simple: receive a request, insert the request into a database, and return whether the insert was successful. I'd like to rely on XML validation to…
Matt Luongo
  • 14,371
  • 6
  • 53
  • 64
14
votes
3 answers

Validate XML with VS Code

I was a Mac user with BBEdit & Co. Now I'm on Windows with VS Code. I'm looking for an easy solution to validate XML with VS Code. Is there an extension for this? Thanks!
Haeme Ulrich
  • 153
  • 1
  • 2
  • 6
13
votes
1 answer

Does libxml2 supports XSD 1.1

Does libxml2 latest release supports XSD 1.1 for XML validation? I am using libxml2 v2.6.30 for XML validation with XSD (schema) 1.0. But, I it does not support XSD v1.1. I am not sure if the latest version of libxml2 supports XSD 1.1 or not. Any…
Zeeshan
  • 539
  • 4
  • 19
12
votes
3 answers

JAXB: when using XML schema (.xsd) to validate an XML file, if validation fail, can I know which XML tag causing it?

so right now when I validate the XML file using an XML schema, I am only able to know whether it fail or pass, and if I want to know why it fail, I need to look at the error message like [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a:…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285
12
votes
1 answer

The difference between and in XSD?

What is the difference between and in XML Schema?
huangweiwei
  • 161
  • 1
  • 2
  • 9
12
votes
5 answers

How to validate xml with php

I have made an api with xml based request for my website. but sometimes, some customers send me an invalid xml and I want to return a good response. how can I validate xml? edited: Ok, I think I asked wrong question, I want to validate nodes and if…
Pooya
  • 1,508
  • 3
  • 17
  • 38
11
votes
1 answer

XSD element substitution group example?

I'd like to be able to specify single choice type for multiple extending types. For example, say we have the sea, in the sea there are many kinds of fishes. So in XML I will write:
Slime recipe
  • 2,223
  • 3
  • 32
  • 49
1
2
3
66 67