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
5
votes
3 answers

error: Error parsing XML: mismatched tag

I am getting this error: Error parsing XML: mismatched tag. If anyone knows how to fix this, can you please let me know what I'm missing, thank you.
Harrison
  • 457
  • 2
  • 7
  • 12
5
votes
3 answers

Grab, cache and parse remote XML feed, validation checks in PHP

Currently, I'm grabbing a remote site's XML feed and saving a local copy on my server to be parsed in PHP. Problem is how do I go about adding some checks in PHP to see if the feed.xml file is valid and if so use feed.xml. And if invalid with…
p4guru
  • 1,400
  • 2
  • 19
  • 25
5
votes
2 answers

Intellij IDEA : How to validate XML SCHEMA 1

I am trying out XML SCHEMA 1.1 in IDEA 13.02 with JDK 7 This is an XML schema code I got from a tutorial. When I open this file in IntelliJ IDEA and click "Validate" , I get the following errors: cvc-complex-type.2.4.a: Invalid content was found…
user193116
  • 3,498
  • 6
  • 39
  • 58
5
votes
1 answer

Is it possible to show line numbers more than 65535 when you validate an xml file using lxml?

I try to validate an xml file with around 1 million lines using lxml. This is my code. import codecs import lxml.etree as ET xsd_file = codecs.open(r'test.xsd', 'rb', 'utf-8') xml_file = codecs.open(r'test.xml', 'rb', 'utf-8') xmlschema_doc =…
user1610952
  • 1,249
  • 1
  • 16
  • 31
5
votes
1 answer

Element must have no character or element information item [children], because the type's content type is empty

As I work on this project I keep getting an error saying: Element 'Customer' must have no character or element information item [children], because the type's content type is empty. I am not sure why this is not working seeing I followed the…
Andrew Hentrich
  • 61
  • 1
  • 1
  • 3
5
votes
1 answer

Validating XML files against XSD in FireMonkey

I am developing a cross-platform application (for Windows, Mac etc.) and for 32-bit and 64-bit machines. I have lots of XML files which I need to validate against their XSD. Is there any way of doing this in Delphi XE3? I have tried DTD validation…
Padam
  • 117
  • 1
  • 7
5
votes
2 answers

How to set up catalog files for xmllint?

Ok. I want to set up catalog files for xmllint to fix things so that the dcterms xml namespace is validated from a local document. I believe that I have done everything right, but it simply doesn't seem to be working. I am running OSX. I have…
PaulMurrayCbr
  • 1,167
  • 12
  • 16
4
votes
3 answers

Newbie: XSLT Transformation to validate rules in XML document

I'm a newbie to XSLT. I've an XML document and I need to come up with xslt to validate certain rules in the XML document. The XML and xsl file will be used in xsltproc tool and the output will be a simple Pass or Fail. Sample XML: ...
Foo Bar
  • 131
  • 2
  • 8
4
votes
1 answer

xmllint validation error for ID attribute

I'm trying to validate this XML document: Alice Bob against the following…
Maciej
  • 43
  • 1
  • 4
4
votes
2 answers

Perform checks against XML files, such as Oracle OSB files and Soap-UI test files

Looking for a way we can do checks on XML files, beyond just schema validation. Have found a few references to Schematron which looks interesting, but struggling to see how we can piece this all toegether: Problem Background We're dealing with…
Nathan
  • 51
  • 5
4
votes
2 answers

validating xml document in oracle's java source

Trying to do subject. I'm trying to use xsd from file(schemasource = 1) and from clob (schemasource = 0). I have two xsd schemas common_types.xsd and migom.xsd. second includes first. The problem is that when I'm using common_types schema from file…
Andrey Khataev
  • 1,303
  • 6
  • 20
  • 46
4
votes
6 answers

Validating xml nodes, not the entire document

I'm working with some xml 'snippets' that form elements down the xml. I have the schema but I cannot validate these files because they are not complete xml documents. These snippets are wrapped with the necessary parent elements to form valid xml…
ipwnponies
  • 219
  • 1
  • 4
  • 10
4
votes
1 answer

Allow sequence OR empty in XSD

Looking to figure out how to match either on a set sequence or no value. Example below of my sequence, but I'm stuck for how to get it to accept either the sequence as written, or the tag existing with no value inside it.
Matt Klaver
  • 169
  • 1
  • 10
4
votes
1 answer

How to specify spaces in an XSD xsi:schemaLocation relative path?

I am editing an XML file in Visual Studio that references an XSD at a relative path with spaces in one of the folder names. Visual studio does not seem to be impressed. If I remove the space names from the folder it works and I can navigate.
Derek
  • 7,615
  • 5
  • 33
  • 58
4
votes
0 answers

Why is ">" (greater than symbol) supported in XML attributes while "<" (less than symbol) is not?

When I was trying to validate my XML files, I found that ">" (greater than symbol) is supported in XML attributes, while "<" (less than symbol) is not. For example, the following XML element is valid: However, the…
johnlinp
  • 853
  • 6
  • 22