Questions tagged [xmlschemaset]

44 questions
11
votes
2 answers

How to instruct PowerShell to garbage collect .NET objects like XmlSchemaSet?

I created a PowerShell script which loops over a large number of XML Schema (.xsd) files, and for each creates a .NET XmlSchemaSet object, calls Add() and Compile() to add a schema to it, and prints out all validation errors. This script works…
7
votes
3 answers

XmlSchemaValidationException.LineNumber and LinePosition are 0 when validating an Xml Schema with XDocument.Validate

I'm trying to validate an Xml fragment using an Xml Schema with the XDocument.Validate extension method. Whenever an invalid Xml fragment is used the ValidationEventHandler fires properly, however both the LineNumber and LinePosition properties of…
buckindb
  • 103
  • 1
  • 3
5
votes
2 answers

xmldocument and nested schemas

Using c# and .net 3.5 I'm trying to validate an xml document against a schema that has includes. The schemas and there includes are as below Schema1.xsd -> include another.xsd another.xsd -> include base.xsd When i try to add the Schema1.xsd to the…
Stuart
  • 83
  • 6
5
votes
1 answer

No solution to validate XML against XSD in Android

I am trying to validate a XML file against XSD on Android devices. I googled a lot and found some solution like xerces-for-android. In the Stack overflow I found some page like this, which suggests to avoid javax.xml. validation and use Xerces for…
Sohrab
  • 1,348
  • 4
  • 13
  • 33
5
votes
2 answers

compile schemas with included xsd files

I have static method, which i use to validate a XML File against a XSD File. This works fine, until there is an XSD File which includes another XSD File. Example, where i got troubles: TYPES.XSD:
CeOnSql
  • 2,615
  • 1
  • 16
  • 38
5
votes
2 answers

How to compile a schema that uses a DataSet (xs:schema)?

I have created the simplest web service in c#: public void AddData(DataSet ds) The generated schema (Wsdl) looks like this: ... ... Note the schema does…
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
3
votes
1 answer

XmlSchemaSet loads schema without key constraints

When I load a XMLSchema through the following code: _XmlDocument = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Schema; settings.ValidationFlags |=…
simsi
  • 533
  • 3
  • 16
3
votes
1 answer

cvc-complex-type.2.4.b: The content of element 'tns:patient' is not complete

In the below xsd I am trying to create a list of 10 patients using the same schema. When I validate the xml file I get an error saying cvc complex type 2.4.b.Is there any other way I can use to create a list of 10 patients with the same schema…
SuperGirl
  • 33
  • 1
  • 1
  • 5
3
votes
0 answers

How to merge two xsd content into one in C#

I have 2 xsd files content in a dictionary. I want to merge both the contents and create one xsd file. 1st xsd content from dictionary has a import tag pointing to 2nd xsd in the dictionary. 1st xsd -
Rohit
  • 1,520
  • 2
  • 17
  • 36
3
votes
3 answers

System.Xml.XmlSchemaSet compile() fills included schema TargetNamespace

I have two xml schemas: 1) infrastructureRoot.xsd:
2
votes
1 answer

How to iterate/traverse XML file elements( which contains different namespaces) to convert it as Data table in C#

I have a sample to read a xml schema set for a xml file which contains different namespaces. For this i can get different schema for each namespace as i explained below. Sample File:
Ajar
  • 162
  • 1
  • 10
2
votes
1 answer

Get All Derived Types in SchemaSet

I need to find all types in a given SchemaSet. What I do today is: 1) Iterate all XmlSchemaTypes in SchemaSet.GlobalTypes.Values. 2) Iterate all values of XmlTypeCode enum I find this as insufficient because some XmlSchemaTypes can be defined in the…
Ran
  • 21
  • 1
2
votes
3 answers

right approach to handling bad xml data

I've got a little c# windows service that periodically pulls xml from a web service and stores the data in a database table. Unfortunately it's failing because the web service has occasional bad data in it - strings instead of decimals. I don't…
Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
2
votes
1 answer

Why XmlSchemaSet explicitely sets targetNamespace to chameleon schemas

For example, I have 2 Xml schemas: a.xsd: ` b.xsd:
alexanderb
  • 253
  • 2
  • 6
1
vote
2 answers

XmlSchemaSet Add xsd file to validate Xdocument takes too long more than one minute

I am validating and Xdocument to and xsd file and everything works fine, but when I add the Xsd file to the XmlSchemaSet object it takes like one minute and a half to load, the schema is not small but only occupies 50kb which in my opinion shouldn't…
Jaime
  • 11
  • 1
1
2 3