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
8
votes
1 answer

Validate XML against XSD with JavaScript on client side

I am required to show a user an XMLfile in a friendly way as a result I am creating a tree like structure such as: http://thecodeplayer.com/walkthrough/css3-family-tree instead of showing the user the raw XML. Right now when creating a new node I am…
Tono Nam
  • 34,064
  • 78
  • 298
  • 470
8
votes
6 answers

How to get the XPath (or Node) for the location of an XML schema validation failure?

I am using XDocument.Validate (it seems to function the same as XmlDocument.Validate) to validate an XML document against an XSD - this works well and I am informed of validation errors. However, only some information seems to be exposed [reliably]…
user166390
7
votes
2 answers

Using XSD schema validation for XPath queries

I'm using the following code to create a DOMDocument and validate it against an external xsd file. loadXML(file_get_contents($xmlPath),…
agoldev
  • 2,078
  • 3
  • 23
  • 38
7
votes
1 answer

base-uri function in schematron for validating xml probatron + saxon

We used probatron and saxon to validate a test xml using a given sch file in our java application. Recently, a new rule has been added to the sch file such as and some rules use that value, but $foo contains…
benchpresser
  • 2,171
  • 2
  • 23
  • 41
7
votes
2 answers

Is it possible to ignore case using xpath and c#?

Just wondered if its possible to ignore case with c# and xpath when searching an xml document?
Exitos
  • 29,230
  • 38
  • 123
  • 178
7
votes
1 answer

Jaxb validation against schema with only complex types

I have a wsdl that contains request and response elements: This wsdl imports a few xsd's, which contain, among others, these…
7
votes
2 answers

Can xs:anyURI contain square brackets in XSD?

XML Validation fails with error: Element 'CategoryPageUrl': 'http://www.example.com/products?my_query_parameter[]=45' is not a valid value of the atomic type 'xs:anyURI'., line 29 Feed looks like this:
7
votes
2 answers

Disable DTD in javax XML Validator

I am using javax.xml.validation.Validator to validate my xml as below - Validator validator = myschema.newValidator(); validator.validate(new StreamSource(new StringReader(xmlString))); I would like to prevent XML External Entity…
Ankit Rustagi
  • 5,539
  • 12
  • 39
  • 70
7
votes
3 answers

Error: The prefix "xsi" for attribute "xsi:schemaLocation" is not bound

I am having trouble validating my XML against an XSD. The validator throws The prefix "xsi" for attribute "xsi:schemaLocation" associated with an element type "mpreader" is not bound. Here's the an XML clip
Dallan Baker
  • 125
  • 1
  • 3
  • 13
7
votes
1 answer

How do I make a valid inline XML schema?

I need to author an embedded XML schema, i.e. where the schema is define within the same XML as the data. I'm trying to understand how to do it correctly, but so far I'm failing to get a simple example to pass validation. Here's what I was trying to…
Daryn
  • 4,791
  • 4
  • 39
  • 52
7
votes
3 answers

Java XML validation does not work when schema comes from classpath

I am validating XML documents against a schema. Some more complex documents/schemas always fail when trying to validate them using this code: DocumentBuilderFactory dbfac = DocumentBuilderFactory.newInstance(); …
Victor Lyuboslavsky
  • 9,882
  • 25
  • 87
  • 134
6
votes
2 answers

How can I get more information on an invalid DOM element through the Validator?

I am validating an in-memory DOM object using the javax.xml.validation.Validator class against an XSD schema. I am getting a SAXParseException being thrown during the validation whenever there is some data corruption in the information I populate my…
user545680
6
votes
1 answer

Schema validation not trimming strings before validating

I have a problem with validating my XML file, after it has been automatically formatted. The validation doesn't trim the string before validating it. Is this a bug in the implementation of the XML validation of .NET or is this accepted behavior? If…
Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
6
votes
2 answers

Creating XML Schema from URL works but from Local File fails?

I need to validate XML Schema Instance (XSD) documents which are programmatically generated so I'm using the following Java snippet, which works fine: SchemaFactory factory = SchemaFactory.newInstance( XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema…
maerics
  • 151,642
  • 46
  • 269
  • 291
6
votes
0 answers

Signature validation false

I'm try to verify signature like this (it's PARes from Mastercard) and receive false every time, but xml from VISA work ok Mastercard
koa73
  • 861
  • 2
  • 10
  • 27