Click here to Skip to main content
15,885,941 members
Everything / XSD

XSD

XSD

Great Reads

by Dirk Bahle
Tips & Tricks on De/Serializing object graphs with XML
by kingddd
Introducing a new tool to transform trx (mstest results file) into HTML report
by Krishna P Seetharaman
Issues faced and learnings found during the generation of pipe delimited flat file generation
by rvjagadheesh
Brief introduction about YQL (Yahoo Query Language). Also describes how to use the REST API provided by Yahoo! to gather information.

Latest Articles

by Krishna P Seetharaman
Issues faced and learnings found during the generation of pipe delimited flat file generation
by Dirk Bahle
Tips & Tricks on De/Serializing object graphs with XML
by O.Nasri
A good demo to know how you can implement an XSD & XSLT processor using C#
by rvjagadheesh
Brief introduction about YQL (Yahoo Query Language). Also describes how to use the REST API provided by Yahoo! to gather information.

All Articles

Sort by Score

XSD 

22 Dec 2017 by Dirk Bahle
Tips & Tricks on De/Serializing object graphs with XML
10 Feb 2012 by Espen Harlinn
Have a look at xsd.exe[^]The XML Schema Definition tool generates XML schema or common language runtime classes from XDR, XML, and XSD files, or from classes in a runtime assembly. UpdateHave a look at Extreme XML:XML Serialization in the .NET Framework[^]Best regardsEspen Harlinn
16 Apr 2015 by kingddd
Introducing a new tool to transform trx (mstest results file) into HTML report
23 May 2012 by Sergey Alexandrovich Kryukov
Thank you for responding to my comment with the good improvement in the formulation of the question.This is done by using the XSD element with specified scope. Please see the specification, explanation and the code sample...
27 Nov 2013 by Pascal-78
Hi,I'm trying to validate xml data using an xsd defined in memory (not a file).I tried the following code :MSXML2::IXMLDOMParseErrorPtr pError;MSXML2::IXMLDOMSchemaCollection2Ptr pSchemas;HRESULT hr = pSchemas.CreateInstance(__uuidof(XMLSchemaCache60));if(pSchemas){ //...
20 Apr 2020 by Maciej Los
Well... As agreed with @phil.o and @CHill60, the best way is to use XML Schema Definition Tool (Xsd.exe) | Microsoft Docs[^] Alternativelly, you can use XmlReader Class (System.Xml) | Microsoft Docs[^] to read xml data in async mode. Good luck!
12 Jun 2012 by barneyman
You'll have to build a huge regex ... or solve it in an alternative fashion ..How about having child nodes that define the Unit, that way you can have multiple definitions, the XSD is easier to construct and you get easier lookups?ie.
13 Jun 2012 by Henning Dieterichs
Mapping the n:n unit-hierarchy to the 1:n relationship of parent and children in xml will add more complexity (though it is in the sense of xml), since the format won't be extendable (you can simply add a new element to the bottom of a list, but in an hierarchy you have to specify where to add...
18 Mar 2013 by Taresh Uppal
public string GetDataStringXml(DataSet objToXML) { StringBuilder strXml = new StringBuilder(); strXml.Append(""); strXml.Append(""); foreach (DataRow dataRow in objToXML.Tables[0].Rows) ...
9 Aug 2013 by Sergey Alexandrovich Kryukov
It looks like the body of the question has nothing to do with its title.The question about conversion of XML to XSD is incorrect, because: 1) XSD file is already an XML file, and "converting" a file to the identical file makes no semantical or practical sense; 2) as to the semantic of those...
27 Nov 2013 by Pascal-78
Using the following code, I got extra information on the errortry{ hr = pSchemas->add("",pSchema.GetInterfacePtr());}catch(_com_error &error){ dump_com_error(error);}And the error was: (translated from french) The namespace "" provided si different from the target...
14 Oct 2014 by Kornfeld Eliyahu Peter
An element like does not declare a null element, but an empty element (0 length string).To make an exiting element that is nullable you have explicitly state it... An other option is to set minOccurs to 0 and...
14 Oct 2014 by Maciej Los
If you have got an *.xml file or class definition, i'd suggest to use xsd.exe tool[^], which enables you to create *.xsd file.On the other site, please see this: Nillable Attribute Binding Support[^]
25 Oct 2014 by Maciej Los
There is a tool, which is named xsd.exe[^]. This is standard tool for Visual Studio.[EDIT]Tutorial: Generate Sample XML from XSD[^][/EDIT]
29 Oct 2014 by Maciej Los
I'd suggest to use xsd.exe[^], which is helpful when you want to create xsd from xml file.For further information, please see:How to: Use the XML Schema Definition Tool to Generate Classes and XML Schema Documents[^]Auto generating Entity classes with xsd.exe for XML Serialization and...
20 Apr 2015 by Maciej Los
Wikkipedia wrote:XML validation is the process of checking a document written in XML (eXtensible Markup Language) to confirm that it is both well-formed and also "valid" in that it follows a defined structure. A well-formed document follows the basic syntactic rules of XML, which are the same...
26 May 2016 by George Jonsson
An XML schema (XSD) IS an XML file by definition, so you can treat it in the same way as a regular XML file containing data elements.See XML Schema Tutorial[^]You might want to tell the receiver that you are sending a schema instead of content.You can do this with, for example, an...
14 Jun 2017 by Kornfeld Eliyahu Peter
14 Jun 2017 by Patrice T
Quote: As per my assumption it allows A-Z, a-z ,0-9 and spacial characters like Back slash, Single Quote, and Hyphen. Your RegEx is a little more complex than that, looks like your problem is that you use RegEx without really learning it. Use last link and paste the RegEx and you will see a...
4 Jul 2018 by Krishna P Seetharaman
Issues faced and learnings found during the generation of pipe delimited flat file generation
1 Jan 2020 by Richard MacCutchan
See XML Schema Simple Elements[^]. You can only declare it as a string and then parse it into its separate parts in your run time application.
26 Dec 2011 by demouser743
Hi all i have my xsd defined as follows Check 12 ...
26 Dec 2011 by sharmarun
can any tell me how to make c# class of a .xsd file using C#.net means how i can use xsd.exe in code behind and save generated class .thanxz in advance
27 Dec 2011 by demouser743
Try this toolhttp://www.bware.biz/DotNet/Tools/CodeXS/WebClient/GenerateInput.aspx[^]
27 Dec 2011 by RaviRanjanKr
Try http://xsd2code.codeplex.com/[^]
27 Dec 2011 by Anuja Pawar Indore
Refer these threadshttp://stackoverflow.com/questions/8009672/how-can-i-convert-xsd-file-to-c-sharp-class[^]http://stackoverflow.com/questions/1060017/convert-xsd-files-to-c-sharp-serializable-class[^]
23 Jan 2012 by jija
Platform : Visual Studio 2010, Windows 7, VC++, MSXML. Hello, I'm working on a project that deals with structured data corresponding to different data formats (EDI, flatfiles, xml) using proprietary classes in an unmanaged C++ code.I need to develop a logic that will replace the...
31 Jan 2012 by Sergey Alexandrovich Kryukov
It looks like you misuse complexType: you cannot specify content of complex type without intermediate XSD node describing the type of complex type content, such as sequence, like in this example: ...
10 Feb 2012 by Charlie Matherne
Currently, I'm adding elements to my XmlDocument using XPath notation for which I've written code to that places the element at the proper location in the file. With one exception. I don't know how to make it pay attention to the sequence rules defined in my XSD file.Is there a way to add an...
23 Feb 2012 by udayRBA
Hi, I am working on c# application dealing with XML data. I've got the XSD file and I have to generate XML file depending on the XSD. 1 solution I know is, using xsd.exe(by genratign class file), but here requirement is quite different. Here, user can give any XSD at run time and according...
24 Feb 2012 by Martin Arapovic
Hi,Check this tool.http://xsd2code.codeplex.com/[^]Maybe it has feature that can fit your needs...
24 Apr 2012 by navanit_kamble
Can you please help me merge a wsdl file and xsd files .I have a wsdl file which is referencing two XSD files .How do I go about this ?Are there any tools to do this or a standard process to be followed ?
2 May 2012 by walterhevedeich
I think this[^] is what you are looking for. Just read the instructions on the Wiki[^] tab before downloading the source code[^].
23 May 2012 by hornet_79
Thanks again... validates now as it should. The important part is Solution looks like this:
8 Jun 2012 by Joshi, Rushikesh
Hi All,How can I remove QualifiedName in XmlSchemaElement? As QualifiedName is readonly, how can I create a new XmlSchemaElement and copy content except QualifiedName from original XmlSchemaElement;ThanksRushikesh Joshi
12 Jun 2012 by Henning Dieterichs
Hello!I want to compose a simple type within a xsd schema.Here a xml example:The 'Definition' attribute consists of two parts: a xsd:double ("0.001") and a custom type (UnitAbbreviation, "m", used for the 'Abbr' attribute...
13 Jun 2012 by ♥…ЯҠ…♥
Actually i was assigned with a task to identifyWhether the XSD UI file can be converted into C# UI solutionI googled a lot regarding this. But i could not find a dime about this.So it will be more helpful to know if it is applicable to do so or notIf applicable means how?...
12 Jul 2012 by Selvasusan
I want to create a tool in windows forms C# , which accepts XSD file and a Excel file (Which contains data). The tool has to generate output as XML with the given Xsd Schema applied on the Excel data. Please note that the XSD and Excel file which I receive will Dynamically change each time. I...
21 Jul 2012 by Sandeep Mewara
Couple of things:1. You have no clue on what are you doing. Not good. XSD is XML Schema Definition - not a database file. Read : http://www.w3schools.com/schema/schema_intro.asp[^]It can be used to define new schema of database but not as a database, here: Generate SQL Database Schema...
20 Sep 2012 by Member 4029130
Hi, I am trying to validate an XML file against a schema, which i can achieve without issue normally, however, in this particular schema, there is an imported namespace, that appears to be preventing the validation from happening, as the error being returned is pointing to node of the...
21 Sep 2012 by Kuthuparakkal
Use the following xsl to strip off multiple namespaces: ...
25 Sep 2012 by zsh64
Hi ExpertsI convert WebApp to website I use XMLSchema.xsd in Web ApplicationCan I use XMLSchema.xsd in Asp.net Website ?(vs 2010)How to use it?
25 Sep 2012 by Kuthuparakkal
Yes very much, use System.Xml namespace:http://msdn.microsoft.com/en-us/library/y3y47afh.aspx[^]
11 Nov 2012 by Manjunathmh
I have an XSD which validate any given xml file and list the errors(giving line number and position).How to resolve these errors pragmatically and update the tags eg: The schema validate tag should not have as his child This is an invalid fileit gives error...
13 Dec 2012 by rossi105
Hi,I have a problem with XML validation. The XSD schema is not to this xml, but validation is true? What is wrong in XSD?XSD:
13 Dec 2012 by Menon Santosh
check this articleSimple code to validate an XML file against a schema file (XSD)[^]
21 Mar 2013 by Sandeep Mewara
It does not work like this here.Here is what is expected of enquirers:1. TRY first what you want to do! You may find that it's not that hard.2. Formulate what was done by you that looks like an issue/not working. Try them and tell if you face issues.Members will be more than happy...
22 Mar 2013 by Nonestop
I want to convert excel file into xml file applied XML schema(xsd file).Input is XSD and Excel file, and output is schematized xml.(I guess the files format are correct, because those were provided as template by supplier's site.)I found some samples in codeproject, but the result...
24 Mar 2013 by Deepu413
I have to define a pattern for a string in the following formatIts a concatenated string having 4 strings separated by "=". It should look something like "string1=string2=string3=string4"Here the length of strings is not fixed so I cannot define a patternstring1 can have 0 to 25...
8 Apr 2013 by Erik06se
Hi. I got a generated class in C# (from a xsd with xsd/c), that got this declaration (together with string-fields, numeric fields and so):private string[] itemsField;private ItemsChoiceType[] itemsElementNameField;The ItemsChoiceType looks like this:public enum ItemsChoiceType1 { ...
9 Apr 2013 by Erik06se
Nevermind, I think I knov the issue. It's because this xsd.exe creates 'DefaultValueAttribute' for those fields. That prevent this field to be in the xml. Maybe some xsd-switch could have done that, I dunno...
3 Jun 2013 by marwa_e
hello i am having a problem with an XSD (XML schema) i wrote a php code to extract an XSD schema file from mysql database but there is something wrong in the schema validation but i dont get it :(here is the schema that i get
7 Jun 2013 by Member 10097563
Hi,I want to convert an excel sheet to XML using XSD by writing a VB Macro.This feature is available in Office 2010 where you can map a XSD file in an excel sheet and click on export XML to get an XML file but it works for simple and non-repetitive nested tags.I have a complex schema...
7 Jun 2013 by Maciej Los
CP Knowledge base:Convert Excel to XML file/XML Schema, and validate Excel against XML Schema[^]Google with: VBA Excel to xml using xsd msdn sentence returns (few example...
18 Jun 2013 by H.Brydon
Providing xmlns="anything" in the root info defines the global namespace for the info in the rest of the file. Your xml is somewhat complex. Removing the global namespace spec somehow changes the xml content. Use of an xml editor might be helpful in decoding the problem if you don't see it...
22 Jun 2013 by Dipesh Tiwari
I am creating a utility to convert the Dataset into xsd file. i am Reading data from database and creating dataset For creation of XSD file i am actually creating a Dataset and Datatable and then i am using Dataset.WriteXMLSchema() to write the xsd file.After my file generated i am getting...
12 Jul 2013 by amin uddin cs
Hi, I have an xml file like
9 Aug 2013 by patelv61
I am in process to convert oracle table to xml and I like to know if there is tool available in Powershell to do this.
19 Sep 2013 by MarkTJohnson
I've been working with xsd for all of 3 weeks now and I am finally starting to understand the basics of how it works but I have found a problem in either the SQLXMLBulkLoad process or the way the xsd is structured. ...
4 Oct 2013 by Naresh1277
ERROR! Line: 0 Position: 0 : The element 'CardPlan' in namespace 'uri:GPI.M2.Order' has invalid child element...
11 Nov 2013 by Member 10329703
I have following xsd -
11 Nov 2013 by Sergey Alexandrovich Kryukov
By W3 standard, the value of the attribute targeted by the attribute declaration of the schema, should be defined as default or fixed, whichever is appropriate, not as "value". Please see:http://www.w3.org/TR/xmlschema11-1/#cAttribute_Declarations[^].—SA
3 Feb 2014 by patil.nitin8358
I want to validate it using enumeration to Restrict a Set of Values(1 or 2 or 3)code value may be 1 or 2 or 3 where code is attribute of element ApplicationStatusPlease help its urgent...
3 Feb 2014 by Maarten Kools
You can create your own type, like so: And then use it like this
30 Mar 2014 by amiach
Hi I try to use my xsd file to generate xml file and .NET Object ClassI execute the command on Developer Command Prompt for VS2012.C:\Program Files (x86)\Microsoft Visual Studio 11.0>xsd.exe /c http://schemas.monster.com/Current/XSD/Job.xsd But I have an error that I can't solve...
30 Mar 2014 by Kornfeld Eliyahu Peter
The problem that xsd.exe can't get its input file in URI format. It expects something like C:\...So download that xsd file to local disk then run xsd.exe no it...
8 Apr 2014 by Sergey Alexandrovich Kryukov
Not clear what your concern is. You validate whole instance of XML against one schema...Please see: http://stackoverflow.com/questions/4134553/c-sharp-validate-xml-against-xsd[^].—SA
31 Aug 2014 by bahman01
When I want to compile, an error shown:#error: The expression you have entered is not valid.Plus in Visual Studio 2010 this message is shown:'if' conditional must have boolean type.and my code for expression is:Message_2.Article.Approved = false;and this is my XML code in scheme...
8 Oct 2014 by Member 10846480
good morning, i am in a win application in c# language. i have to read a excel file (both xls and xlsx) and i would validate it with an xsd file but i wrong something because i get an error: data at the root level is invalid. Line 1, position 1 if i use the same xsd with corrispondent xml file...
9 Oct 2014 by Maciej Los
Excel (starting from 2007 and higher) uses non-typical XML file. See OpenXML standard[^]. You can't validate Excel files this way.Older version of MS Excel does not support OpenXML standard.
13 Oct 2014 by Nilesh_AES
It seems like you have made mistake while promoting your field.In such cases you should use show promotion.
29 Oct 2014 by Manoor Hebbar
I need to create a recursive XSD schema that validates a tree structure of an XML document.Sample XML: ...
30 Oct 2014 by Member 11191404
The element 'Organisation' in namespace 'xxx' has invalid child element 'TIN' in namespace 'XXX'. List of possible elements expected: 'TIN, Name' in namespace 'YYY' But My XSD have the same element . My XML 12 US Kindly suggest me a...
30 Oct 2014 by PIEBALDconsult
Ah, you have a default namespace -- I suspected as much; they cause nothing but trouble.Everything inside that element, including attributes, have that namespace and you will need to specify that in the XSD.
3 Nov 2014 by roca2012
I am receiving XML from the database and trying to process it into my system. I have generated a class from an XSD that I received from the other team. The problem I'm having is that, right now the property names in the XSD do not match up to the property names within my application (typical)....
18 Dec 2014 by jkirkerx
Wasn't sure where to post this question, so I'll post it here.I'm reading this API, and creating an XSD file to code against.This API, has all the names prefixed with v1:The API says The First Data Global Gateway Web Service API uses HTTPS and SOAP to communicate withyour...
18 Dec 2014 by George Jonsson
I think you have an error in the beginning of the XSD.
18 Dec 2014 by jkirkerx
Called tech support and got the other API, which is just straight XML, no v1's and those other pesky attributes. I'm not sure what to think here.
5 Jan 2015 by Yesudass Moses
Hi Friends,I am new to SSIS packages. I have an SSIS package Solution in my local machine. It has an XML Source component which uses an XSD file in my local machine.When I deploy this on my SQL Server, How can I set the path to a new location on server ?Thanks
5 Jan 2015 by deepakdynamite
Better to add an configuration file in SSIS and store your XSD File path in it... This will allow you to change values after deployment.http://www.sqlshack.com/using-xml-file-configure-ssis-package/[^]
6 Jan 2015 by Yesudass Moses
Hi Friends,I have an SSIS Package which reads XML file using XML Source Component.This XML File has two outputs. One is for "Invoice" and other is for "InvoiceDetail"The structure of the XML File is like this. ...
9 Mar 2015 by mwallner
This is a crosspost from stackoverflow. - no answers there, hope you can do better =)I'm currently designing a special-purpose-application in C++ which has to deal with XML-files that come with evolving XSD-schemes. This application will need to be supported quite a while in the...
11 Mar 2015 by Sergey Alexandrovich Kryukov
In XSD, you can make some element optional or mandatory. This can be controlled by explicitly defining the multiplicity, which can be understood as a constraint over the number of occurrences, using the attributes minOccurs and maxOccurs. Here the usage is explained on a simple sample:...
12 Mar 2015 by Maciej Los
I found 2 links:http://stackoverflow.com/questions/8925706/xml-schema-how-to-restrict-attribute-by-enumeration[^] - this one you have probably seen before, because you used similar...
17 Mar 2015 by Member 11149146
[I don't think there's any way of doing this in XSD 1.0. In XSD 1.1, like most things, it can be done with assertions.]
23 Mar 2015 by Umesh AP
I have complex type (EmployeeInfo) defined in an .xsd file. So how can i use that type in my C# Web Service class? I already done lot of search on Google but can't find proper information. Thanks in advance.
26 Mar 2015 by johannesnestler
So you can use the xsd Tool manually to generate the classes.See https://msdn.microsoft.com/en-us/library/x6c1kb0s(v=VS.100).aspx[^]for documentation.You find the tool in the .NET SDK Folder. E.g C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
30 Mar 2015 by Member 10769366
There is some straight forward code to convert XSD file to XML file. But I'm unable to convert the vice versa. Need a C# code to convert XML to XSD.
20 Apr 2015 by Lalyka
I want to send a http request from client to local server and on the server I made a query with Linq that returns data in xml I also have .xsd file and a .cs file enerated from my xsd file that I want to validate my xml with. I have several questions:how can I validate xml with c# generated...
28 Apr 2015 by Lalyka
I am writing a XML validator with xsdbelow is what I did,but when I reach the line while (list.Read()) it gives me the error "There is no Unicode byte order mark. Cannot switch to Unicode." can anybody help me fix it?public class Validator { public void Validate(string...
28 Apr 2015 by Leo Chapiro
Basically take a look at this answer:Use XML reader instead of XML dom. XML dom stores the whole file in memory which is totally useless: XmlReader ClassYour second question:Quote:How to use/access "private ATXARPACKAGE[] aRPACKAGESField" Why have you made this variable...
28 Apr 2015 by Mehdi Gholam
Start here : http://stackoverflow.com/questions/15772031/how-to-parse-very-huge-xml-files-in-c[^]https://msdn.microsoft.com/en-us/library/bb387013.aspx[^]
16 Jul 2015 by phil.o
Learn XSD, and type your schema definition by hand in a text editor (I've done that once, a long time ago).Or get an XML/XSD editor that could allow you do that graphically. I use XMLPad but if think there exist other open-source XML tools.
23 Jul 2015 by KVPalem
We are trying to validate xml based on schema with below codeXElement xmldata = XElement.Load(@"Ad.xml");XDocument acordRequestxml = XDocument.Parse(xmldata.ToString());XmlSchemaSet schemaSet = new XmlSchemaSet();schemaSet.Add("", @"Schema.xsd");acordRequestxml.Validate(schemaSet,...
11 Aug 2015 by User 11060979
Not the solution, but a "pragamtic workaround" to proceed work.I'm far away from be an expert on this, but my inspration told me to remove this "signature things", so I removed the line:And see... the DataSet will be created and I can...
29 Dec 2015 by Ravindranath.net
Hello,I would like to validate my input object using the xsd file I defined. Would you please let me know how to do this?below is my c# objectusing System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace...
29 Dec 2015 by Mathi Mani
Hi Ravindranath.net,You can validate a XML against a XSD using the Validate extension method.Here is the code showing how to do it. XmlSchemaSet schemaSet = new XmlSchemaSet(); DirectoryInfo dir = new DirectoryInfo(""); foreach...
31 Jan 2016 by rvjagadheesh
Brief introduction about YQL (Yahoo Query Language). Also describes how to use the REST API provided by Yahoo! to gather information.
21 Feb 2016 by prat10j
I have created a class library in which all the schema are added. The xsd schema have relative schemas (import/include).The dll of this project is referenced in another application where I need to validate the input XML, using these referenced dll schema.Please help me, how can I...