xsd

Validate XML Schema with xsd file in Cocoa?

I have some XML and an XML Schema in a local xsd file. The XML document does not contain any schema information. I want to validate the XML document against the xsd schema file in Cocoa (meaning I'd prefer something NS/CF/libxml based as opposed to an external library). I can across xmllint, which would probably work, but I was lookin...

Traversing XML Schemas Failed. (System.Xml.Schema and C# used)

Hello all, Good day. When i try to run the example from MSDN. But it failed at running time. Error Alert: An unhandled exception of type 'System.Xml.XmlException' occurred in System.Xml.dll Additional information: 'type' is an unexpected token. Expecting white space. Line 7, position 24. My Code http://msdn.microsoft.com/en-us/libr...

XML Schema reading/editing in vim?

Hi all, As XML Schemas can be tedious to read (yes, just want to read through the schema) in their normal form, I'm wondering if anyone knows of an existing plugin for vim which will display the schema in tree form, as several XML editors do? Selection of a node in this tree to navigate to the relevant section of the schema would be a g...

how to use javascript to validate xml against schema in firefox?

I can do this in IE using ActiveXObject, however mozilla doesn't support ActiveXObject. Is there any way I can use JS to validate an XML against an XSD schema in firefox? ...

XSD: How to validate the XML file according to value of some tag ?

Hi! I was trying to validate this XML file ... where if <tag1> is "Y" then <tag2> must appear if <tag1> is "N" then <tag2> must not appear .. <parent> <a> <tag1>Y</tag1> <tag2>sometext</tag2> </a> <a> <tag1>N</tag1> </a> </parent> I tried <choice> tag but doesn't seem to work .. :( I have come to conclusion th...

How do I get schema information for a node in a XmlDocument?

Having a XmlDocument loaded with a XSD schema, how do I get the restrictions for a given node in the document? I would like to iterate through the document, and automatically correct errors where possible (eg: truncate strings that are too long, remove empty nodes that shouldn't be, etc.) I am doing this because xsd.exe does not take i...

XML Schema (XSD): How to express "At most one element from group A and at most one element from group b"?

Say I have two sets of XML elements: <One/> <Two/> <Three/> And <A/> <B/> <C/> And I want to have them as children of a bucket element: <Bucket> <A/> <One/> </Bucket> Or <Bucket> <C/> <Two/> </Bucket> But I don't want to allow more than one element from either set of elements. I.e: <Bucket> <A/> <B/> <On...

XDocument.Validate custom validation messages

I'm validating an XML file against a schema using XDocument.Validate and get validation messages which look something like this: The 'http://www.blablah.co.uk/schemas/cbds%3ADOB' element is invalid - The value '1999-0dsf2-21' is invalid according to its datatype 'http://www.w3.org/2001/XMLSchema%3Adate' - The string '1999...

how to convert .xsd file to wsdl?

Hi All, I have .xsd file i need to convert it into wsdl,how would i do so?and is this conversion the right approach. I have request and response data in same .xsd file ...

Modify xsd:dateTime simple type to use different date-and-time separator

I have a legacy system that produces XML with timestamps similar to ISO 8601, but with space used to separate date and time. E.g. 2009-12-31 00:00:00. I would like to define a schema that defines the possible range for these timestamps. xsd:dateTimewould be well suited for that purpose, however, it uses T as the separator between date an...

Any robust DTD to XSD schema conversion tools?

Tools to convert a legacy DTD to XSD which are accurate. ...

nillable and minOccurs xsd element attributes

I am going back and forth with setting an element to minOccurs="0" and nillable="true". I was reading this article and now in my WSDL I'm not sure if using both is worth it. The article gives a good example of representing arrays where you might have null values interspersed throughout, as this can't be done with just minOccurs="0". Now...

XSD and Date Range Validation

How would I write the XSD to validate the StartDate element and EndDate element are within the Quarter element and Year element? Thanks. <OrganizationName>Chevron</OrganizationName> <Quarter>4</Quarter> <Year>2010</Year> <Fuel> <FuelPathwayCode>CARBOBCB001</FuelPathwayCode> <PhysicalPathwayCode>PP001</PhysicalPathwayCode> <transacti...

Use two schemas in one xml

Hi! I have the following xsd files: SchemaA <?xml version="1.0" encoding="utf-8"?> <xs:schema targetNamespace="http://schemaA" elementFormDefault="qualified" xmlns="http://schemaA" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; <xs:element name="Configuration"> <xs:complexType> <xs:all> ...

What do I specify in my XSD to skip attribute validation for a xml tag.

Hello SO, My xml file is structures like below <outer> <inner name="nam" attribute1="abc" attribute2="def" /> </outer> Now, the only attribute I am assured of in the 'inner' tag is the 'name' attribute. Other than that I do not want to apply any restriction on the name or number of attributes the 'inner' tag can have. That would i...

Regression testing for schema (xsd) equivalence

Hi all, I am thinking about rewriting a schema with lots of standalone complex types in it, into one where the complex types extend other base types more sensibly. The rationale for this is partly conceptual - because most of these types are specific instances of a domain object with a definite hierarchical structure - and partly pract...

Calling subclass properties in code-generated (via xsd.exe) classes

I'm trying to generate code from an XSD that has two complexTypes extending a common complexType. The inheritors have a common property named "value", which has different types. Of course I can't put it on my base type due to XSD rules. My intention is to polymorphically call the property on the base type which would invoke the right ...

Creating a WPF editor for XML file based on schema

Here's the scenario. We use a large XML configuration file for one of our server products. This file is fairly well layed out and is validated against an XSD file. It's time now though to build a configuration GUI for maintaining this file and I would like to dive into WPF to do it. I could lay out a seperate form for each config sectio...

XML Schema - only one element should have attribute set to true

How can i define an boolean attribute that can be set "true" only in one element. Following snippet must be invalid. <products> <product featured="yes">Prod 1</product> <product featured="yes">Prod 2</product> </products> ...

What is wrong with this xsd?

The following XSD should validate that the favorite_fruit element's name attribute should only contain names of fruit in the fruits element. Here is the XSD: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <xsd:complexType name="Fruit"> <xsd:attribute name="name" type="xsd:string"/> </xsd:complexType> <xsd:comp...