Questions tagged [xsd-validation]

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

1640 questions
3
votes
0 answers

Importing XSDs from other projects

I'm using SpringSource Tool Suite 2.7.0.M2, which is Eclipse 3.6.2. I'm on Mac OS X 10.6.7, but this issue isn't OS-specific, so for whatever that's worth... I have an XSD that imports another XSD. In our existing structure, this is in a build…
Spanky Quigman
  • 870
  • 7
  • 16
3
votes
1 answer

C# validating XML with XSD without loading unvalidated XSD?

A security scan of our C# source reported "Missing XML Validation" as a possible injection flaw. It cited https://cwe.mitre.org/data/definitions/112.html and other sources. Its recommendation was: Always enable validation when you parse XML. If…
Michael Levy
  • 13,097
  • 15
  • 66
  • 100
3
votes
1 answer

Does pattern validation differs in XSD?

I am trying to validate a XML element with XSD pattern validation using below pattern and it's not working. The required behavior is to allow all characters excepts the ones mentioned in pattern expression.
springenthusiast
  • 403
  • 1
  • 8
  • 30
3
votes
2 answers

ADO.Net Entity Framework generate model from XSD file

I have a rather large XSD file and I have heard that it is possible using the entity framework to connect to XML files like databases and validate them against the XSD, however I do not know how to go about doing this. So what I'm trying to do is…
Alex Hope O'Connor
  • 9,354
  • 22
  • 69
  • 112
3
votes
1 answer

XSD - Making elements optional and mandatory in an XML schema

The schema I have generated for an XML looks like below:
3
votes
1 answer

How to define an integer range in XML / XSD?

I currently have this in an XSD: How can I add a rule that also only allows the value of Qty to be between 100 to 2000?
MTplus
  • 2,077
  • 4
  • 34
  • 51
3
votes
2 answers

Restricting to values of 01 through 10 in XSD?

I'm trying to understand the use of patterns in XSD. Hows does '+' in a pattern for a restriction work in XSD? After some research, I found out that I can use restrictions with patterns. I do understand that the "+" means 1 or more. But will it also…
3
votes
1 answer

XSD enumeration plus empty string?

I have the XML node paymentStatus, and I just want to restrict it using these three entries 'approved', 'pending' and 'completed'. This field is optional and can also contain empty string.
Techgeeks1
  • 556
  • 1
  • 4
  • 18
3
votes
1 answer

XSD validation - The "xs" for element "xs:schema" is not bound error

I'm a beginner. Here is my XML Schema code :
FF FF
  • 31
  • 1
  • 2
3
votes
1 answer

XSD error: References from this schema to components in no namespace are not allowed

The following is my XML Schema followed by the .xml file that I want to validate against. I continue to receive the error Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in no…
Ross Rhone
  • 197
  • 3
  • 14
3
votes
1 answer

XSD reuse a choice of elements without wrapping it

I need to write an XSD for an XML which contains recursive expression trees like that: X 5 where operands can always be any of var, const, call, unary, binary, so for example these are also…
scriptfoo
  • 476
  • 5
  • 17
3
votes
1 answer

Error: The content of 'persons' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*))

I am trying to type XSD for XML but an error has occurred. I don't know why it's occurring. I'm new to XML so don't really know much about it. Error is: Exception: s4s-elt-must-match.1: The content of 'persons' must match (annotation?,…
anchal saini
  • 105
  • 2
  • 9
3
votes
0 answers

XSD Validation - minLength attribute does not work

I want to validate one of the required data field which contains a string. data are in a tab delimited file. I have created a simpleType as below,
Ash
  • 447
  • 2
  • 6
  • 19
3
votes
0 answers

Fix invalid child element in WCF RIA with SOAP endpoint

Is there anyway to fix the warning that Visual Studio flags when you try and add the SOAP endpoint to a WCF RIA service ? The element 'system.serviceModel' has invalid child element 'domainServices' I found one blog post, Silverlight forums, but…
SteveC
  • 15,808
  • 23
  • 102
  • 173
3
votes
1 answer

Value of XML element depends on values of other elements in XSD?

As example, let's say that orange GMC trucks are worth $20,000 while white and black GMC trucks are worth $10,000. Given the following XML:
shrewmouse
  • 5,338
  • 3
  • 38
  • 43