xsd

XmlDocument.Validate ignore properties without [XmlIgnore]

I have a object that has a number of properties that aren't present in the xsd file. When doing XmlDocument.Validate is there a way I can tell it to ignore properties that are not present in the xsd and instead just ensure that the properties required by xsd are present in the xml document? I can get around this by adding [XmlIgnore] at...

How do I verify the same element appears multiple times in an XSD

Hi, I have an XML document which is to have the following tags: <step id="navigation"> ... </step id="background"> <step id="content"> ... </step> How do I make sure steps with ids of content, background, navigation, etc. appear in my document only once? Right now I have <xs:element name="step" maxOccurs="1"> <xs:c...

xsd: elements based on specific id

Hi, I have an XML document which is to have the following tags: <step id="navigation"> ... </step id="background"> <step id="content"> ... </step> I want to be sure, say, id="content" has children elements, say <page> and id="navigation" has specific elements of say <id> How can I ensure this? Thanks ...

Dot net 3.5:how to enable intellisense while writting xml file refering to defined schema?

I have defined a xml schema as below <?xml version="1.0" encoding="utf-8"?> <xs:schema id="PacketTemplate" targetNamespace="http://tempuri.org/PacketTemplate.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/PacketTemplate.xsd" xmlns:mstns="http://tempuri.org/PacketTemplate.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"&g...

Why do some generated C# class properties not match the XSD attributes?

I'm generating C# classes from an OTA (Open Travel Alliance) XSD file. You can download the XSD file from here. I create the C# class with the following command in a Visual Studio Command Prompt: xsd FS_OTA_VehLocDetailsNotifRQ.xsd /classes /nologo Within OTA_VehLocDetailsNotifRQ.POS[0].RequestorID I would expect to find an ID proper...

Transform XML into specified ordering (DTD -> XSD)

I have a project where the main file we are dealing with is an old XML file where the creator made a very unstructured DTD (All elements are optional, and can occur 0 or more times. Even better the application which reads the file actually expects many of the values as required). I have created an XSD based upon known application require...

Xml in Dot net 3.5:how to load xml document into object of class generated from schema?

I have defined schema for xml in file "packetTemplate.xsd".Using ms tool "xsd.exe" i have generated class "PacketTemplate" corresponding to schema.Does dot net provides api that can load xml document by refering to file and returns object of class PacketTemplate. ...

How to create SimpleType enumeration with xmlspy in schema ?

Hi, I'd like to know how to create a SimpleType that is a enumeration with XMLSpy. Do you have link or something useful that can help me ? it's simpletype for country code enumeration AD ("ANDORRA") enumeration AE ("UNITED ARAB EMIRATES") enumeration AF ("AFGHANISTAN") enumeration AG ("ANTIGUA AND BARBUDA") enumeration AI (...

Validating XHTML elements with XML children

G'day guys, I've tried reading the XML Modularization recommendation which promises to allow custom XHTML extensions but can't make heads nor tails from it. I need an XML document containing a mix of XHTML and user-defined XML elements to validate and having trouble doing so. Unfortunately I'm using an XSD and not a DTD, a la XSL which v...

XSD pattern to match a priority order of comma separated words

I have a tag like this <order>foo,bar,goo,doo,woo</order> that I need to validate with an xsd. How do I write a regexp pattern that matches the string that contains: List item any of {foo,bar,goo,doo,woo} maximum once or is empty. Valid examples: <order>foo,bar,goo,doo,woo</order> <order>foo,bar,goo</order> <order>foo,doo,goo,wo...

Where are the code gen templates for .xsd datasets?

Do they even exist? We have a website with a massive DAL using strongly typed datasets. I think it would be great if I had a way to inject some tracing calls before and after each of the database calls. I don't see any events, nor any other way to hook into the TableAdapter such that I can get tracing calls before it executes the sql....

ASP.net Compile time XML/dataset checks

I would like an automated way to run compile time checks on datasets (or any xml) to make sure that expected values are found for certain properties. I have a fairly complex dataset in my asp.net Web Site. After modifying a query Visual Studio regenerates the tableadapter object and returns many properties to their default values. Thi...

Error while validating XML file with XSD

Hi, I have a xml file, let's call it test.xml and I have a schema for validation (schema.xsd). I'm also using the last version of TomCat. I was wondering what could cause the following errors : Error: URI=file:///C:/../Upload/test.xml Line=2: Document is invalid: no grammar found. Error: URI=file:///C:/../Upload/test.xml Line=2: Documen...

how to customize the xsd that axis2 generates

I am following the "web service from pojo"[1] bottom-up guide in axis2 documentations, but the wsdl that is generated is not good. Specifically, the xsd schema that is embedded in the wsdl is not good and I want to customize it. I want to allow cyclic references, in a similar fashion to what jaxb lets you do with XMLID and XMLREFID. Any...

XSD transformation into XML

How can I create a (empty) XML file trough a existing XSD schema? Which PHP (5.3) functions are necessary? ...

How to parse XML Schema File

Hello all, Good day. How to parse XML Schema(.xsd) file and generate to c# class file. About my project: Step1. Parse XSD file (C# lang) ----Build Time -----> Generate CCode Dictionary(C# Class) Step2. Paser XML file(C# lang) ----Run Time -----> Fill the CCode Dictionary with the XML file value (C# App) I researched the tools o...

Tool to create SQLXMLBulkLoad Schemas?

SQLXMLBulkLoad requires schemas to be annotated with various attributes (e.g. sql:datatype) and some additional elements. Is there any tool that can enrich a schema with this information for at least some basic scenarios? ...

Load XML file into DataTable (not from a Database)

I'm looking into changing my application to load its xml format data files into DataTables (and a DataSet?) instead of deserializing them into classes. I can generate a dataset using xsd.exe, but I'm not having any luck finding any examples showing how to use it. My Google searches have been hopelessly clogged with examples using xs...

Display XSD-defined default value of attribute using XSL

I thought this ought to be simple to find, yet after some searching I found this might be nice to define clearly. In my XSD I've defined an enum, derived from string. In a complex type I've defined and attribute that refers to this enum, with a default value. In my XSL I wish to display the default value of this attribute for elements ...

Query a DataSet

I'm reading data from xml files into a strong typed DataSet. The data ends up in multiple tables; can I run queries against it to create a denormalized view to display in a DataGrid? Sample input: <PeopleFile> <address> <street>123 some street</street> <town>anytown</town> <resident> <first>Jane</first> <last>Doe</last> ...