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

How to link XML to XSD using schemaLocation or noNamespaceSchemaLocation?

I found some tips for this problem, but still didn't help me. Here is my XML
porandddr
  • 129
  • 1
  • 1
  • 6
11
votes
1 answer

Using .NET to validate XML against a schema

I want to test (true or false) whether an arbitrary XML file matches a given schema. For what it's worth, the schema is the Word 2003 WordML schema, which Microsoft defines using a list of about 7 *.xsd files. One of these files also includes the…
ChrisW
  • 54,973
  • 13
  • 116
  • 224
11
votes
2 answers

Validation Failed: "EntityRef: expecting ';'"

Hi I've got some XML that won't validate. I've narrowed down the problem to this bit:
Laxmidi
  • 2,650
  • 12
  • 49
  • 81
11
votes
2 answers

The element "x" in namespace "xSchema" has invalid child element "y" in namespace "xSchema". List of possible elements expected: "y"

I am writing a schema for my XML validation final, and finally got everything (just about) working. But now I'm getting the strangest error in my XML. I'll start by showing my schema since that's where the problem should be located yet it gives me…
user2843457
  • 389
  • 2
  • 3
  • 11
11
votes
1 answer

XSD: default integer value range

Is there an implied default value range when defining an element of a specific data type in an XSD file? For example if I define an element of type integer: Does this have an implied min and…
Jeff
  • 370
  • 1
  • 2
  • 11
11
votes
3 answers

Possible to validate xml against xsd using code at runtime?

I have xml files that I read in at runtime, is is possible to validate the xml against an xsd file at runtime? using c#
JL.
  • 78,954
  • 126
  • 311
  • 459
10
votes
2 answers

Error: It was detected that 'sites' has no namespace, but components with no target namespace are not referenceable from schema document

I have been working on this "advanced" schema for days with the flu and I cannot figure out why it keeps telling me that "sites" is not found. I re-read the chapter and even created a copy to experiment with (which worked before) and I do not…
Pau808
  • 213
  • 1
  • 2
  • 10
9
votes
2 answers

XML Signature element is not declared

I created XSD using Visual StudioXML Tools. And I use following C# code to validate XML and facing this error. Error The element is not declared 'http://www.w3.org/2000/09/xmldsig#:Signature'. So my question is how to fix it because in edit mode…
NoWar
  • 36,338
  • 80
  • 323
  • 498
9
votes
2 answers

How to validate an XML document?

My C#/.NET application reads XML files that are manually edited by the users. The allowed elements and tags are described in the application's documentation. I'm using LINQ to extract data from the XML file. Before extracting data from the XML file,…
geschema
  • 2,464
  • 4
  • 30
  • 41
9
votes
5 answers

src-resolve: Cannot resolve the name 'ds:Signature' to an 'element declaration' component

I want to do schema validation using an XSD file. When I import the XSD file to Eclipse, without running the validation class, I have the following error: src-resolve: Cannot resolve the name 'ds:Signature' to an 'element declaration'…
bsel
  • 197
  • 1
  • 4
  • 16
9
votes
1 answer

How to speed up the XML DTD validation with PHP?

I am walidating my XML with a DTD file I have locally. For that, I am doing: $xml = $dmsMerrin.'/xml/'.$id.'/conversion.xml'; $dtd = $dmsMerrin.'/style_files/journalpublishing.dtd'; $dom = new…
Milos Cuculovic
  • 19,631
  • 51
  • 159
  • 265
9
votes
1 answer

Validate xml created using jaxb against an xsd file

I have a xml file created using jaxb. I need to validate it against a xsd document. Is it possible to just do validation without unmarshalling. I need to then print the errors in the xml file.
Anand B
  • 2,997
  • 11
  • 34
  • 55
8
votes
1 answer

External referenced DTD in XML

test.xml: test@test.com xxx@example.com Hello Dear John....;-). test.dtd:
user547995
  • 2,036
  • 8
  • 33
  • 62
8
votes
4 answers

The most performant way to validate XML against XSD

I get a string variable with XML in it and have a XSD file. I have to validate the XML in the string against the XSD file and know there is more than one way (XmlDocument, XmlReader, ... ?). After the validation I just have to store the XML, so I…
Hinek
  • 9,519
  • 12
  • 52
  • 74
1 2
3
66 67