xsd

Creating XSDs in Bulk

I have about 45 XML data files and I need to create XSDs for them. I have Visual Studio 2008 installed. What I am doing right now is opening up each XML file and creating the XSD from the menu option and then saving the XSD. Is there a command line option for me to create all XSDs? If not, is there a bulk XSD generation tool that can ...

Validation xml to xsd to only catch specific errors.

I have an import file that needs to have skip and continue on specific errors. I want to ignore the errors for data type, min/max length, and required fields. I want to catch and display errors about items not formatted correctly and in the wrong location. In this case the file contains a collection of people. I want to catch are err...

Generate LINQ DataContext from XML, XSD, or C# class

Hi, I have a massive set of classes I need to create from an XML file that I'd really not like to do by hand. What I'd really like to do is somehow generate a LINQ DataContext so I can use VisualStudio to build a SQL database from the DataContext. I'm aware that I can generate XSD and C# classes from the XML file, but are there any tool...

beautifying multiple XSD files

I have about 50 XSD files that are really badly formatted. I know if I open them all in Visual Studio, I can beautify them one by one. My question is: Is there a way to command line beautify them or some way I can do this in bulk? ...

Viewing XSD as code

When I open XSD files in Visual Studio, some of them open up as diagram representations, while some open up as code. How do I switch between the diagram view and code view? ...

How to parse a XSD file.

I am writing a code generation tool that will take in a XSD file generated from Visual Studio's Data Set Generator and create a custom class for each column in each table. I already understand how to implement a IVsSingleFileGenerator to do the code generation and how to turn that single file generator in to a multi-file generator. Howev...

XSD.exe warning-error

I have some xsd's given to me and i want to generate C# classes to create xml documents based on these classes. I have problem generating classes though from those xsd! I get schema validation warning: Type'http://ww...../types:ExampleNameType' is not declared, or is not a simple type. Ok they gave me some xsd's declaring the types and ...

C# XmlDocument.Validate Method calls the ValidationEventHandler numerus times, but line number and position are allways 0

I'm trying to validate an XmlDocument instance using an XmlSchema object (xsd schema). When I call the Validate method of the XmlDocument my ValidationEventHandler is called, but the Exception.lineNumber and Exception.linePosition are always 0 (zero). This is the code I'm using: //Validate XML against xsd schema XmlDocument doc = new Xm...

How can I create a general XSD complex type?

I just started using XSD today to bear with me if this a kind of a dumb question. I have an XML schema where three root elements, A, B, and C, are defined. Each of these elements may have a child of type 'example'. The 'example' type has three different attributes. While A, B, and C may only have a child of type 'example', the requirem...

prevent Visual Studio 2008 from creating xsc, xss files when I try to open xsd file

I used xsd.exe to generate a schema file for some XML. I want to include that schema file in my C# project in Visual Studio, but every time I add the .xsd file to my project and then double-click it to open it, Visual Studio creates these .xss and .xsc files for my .xsd file and it alters my .xsd file. How can I get it to stop automagi...

How can I create a schema which requires certain elements, allows others, and is order-agnostic?

I want to create an XML schema that contains the following: <xs:complexType name="Record"> <!--required elements--> <xs:element name="RecordTag" type="xs:string" minOccurs="1" maxOccurs="1" /> <xs:element name="RecordSize" type="xs:string" minOccurs="1" maxOccurs="1" /> <xs:element name="RecordSection" ty...

XSD regex failed validate: Unexpected meta character

Hi all, This snippet <xsd:element name="HomePhone" minOccurs="0"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:pattern value="^+[0-9]{1,2}-[0-9]{1,2}-[0-9]{3}[0-9]{0,1}-[0-9]{3}[0-9]{0,1}$"></xsd:pattern> </xsd:restriction> </xsd:simpleType> </xsd:element> is returning th...

Problem in exporting to MS-Project xml format. Completed work cannot be exported.

Hi, I am Exporting data to ms-project xml file using the mspdi.xsd and I was able to successfully create the xml file and it is opening properly in the MS Project also. But I am not able to export the percentage work completed. Following is the generated xml and if we open teh file, we can see all the data except the percentage complete...

Read flat file by XSD C# language

I am a newbie in programming. I have XSD that describes objects. With these objects I can describe any flat file (e.g 02.02.2010 or 1 2 3 4 3 4 5 45 12 , I will describe it with some "array object" and primitive types (Date and Integers)). I have problems to start to implement. When I have the flat file probably I have to make a...

XML Schema: comparing to date elements

I have an XML file like this: <?xml version="1.0" encoding="UTF-8"?> <items> <item id="1"> <valid_from>2010-07-09</valid_from> <valid_to>2010-07-12</valid_to> </item> <item id="2"> <valid_from>2010-07-09</valid_from> <valid_to>2009-07-12</valid_to> </item> </items> Is it possible to defi...

Generate xsd schema from java source

Given a few hundred java source files how can I generate an xsd schema that describes their class hierarchy, attributes and methods? Most of the resources I've seen describe how to convert java to xml given the schema but how is that schema created? I did find Simple but that requires me to alter the source which I am not allowed to do....

XSLT transform creates StackoverflowException

I tried to perform XSLT transform of a XSD file. My goal is in the end to create SQL from XSD. So far so good, this is what I have: void Convert() { XPathDocument xpathDoc = new XPathDocument(@"myschema.xsd"); string xslPath = @"convert.xsl"; XslCompiledTransform transform = new XslCompiledTransform()...

WPF MVVM - query about designing Models based on XSD

hi there, I have a small WPF application based on MVVM priniciples. So far I had dummy Model classes created in my app. Now I plan to call a Web Service that uses XSD. Looking forward I would like to use these Xsd Types as Models. I can see atleast two way of doing this (could be more); for eg - add a reference to the Web Service. T...

XSD .net code gen + alternative serialization methods

I'm having a time deciding on a direction to go with a class lib I'm building. I have a batch of industry standard XSD's, from which I'm generating .net objects. I;ve used all of XSD.exe, LinqtoXsd, xsd2code, and even OxmLibrary with varying results. But in the end, I am able to generate decent .net classes which can be serialized/dese...

need help in writing in xsd for xml?

need xsd for the following xml <Author Title="Mr." BirthYear="1882"> Lalchand </Author> i wrote like this <xs:element name="Author"> <xs:complexType> <xs:attribute name="Title" type="xs:string"/> <xs:attribute name="BirthYear" type="xs:string"/> </xs:complexType> </xs:element> need help in writing the value of Author that...