xsd

What is the purpose of XSD files ?

though we can query on the xml file from c# (.net). why need of .xsd file ? I know it is metadata file of particular xml file. we can specify the relationships in xsd. but what its functioning then ? Sure: See, I have the xml: <?xml version="1.0" encoding="utf-8" ?> <Root> Customers-> ->Customer ->CustomerID="GREAL">-> ...

SQL TEXT type in Dataset Designer

I'm using Visual Studio's designer to create a typed data set, and I've changed one of the fields in the stored procedure to be a TEXT type. I now can't refresh as the TEXT type is not comparable. How do I get around this? ...

Sort XML file based on XSD format in .Net

I have a requirement to generate XML, validate against an XSD and (if valid), send the XML to a third party. My problem is that generating the nodes of the XML file in the correct order (as the XSD defines it) is very difficult with my current scenario. Writing the code to manually add the nodes in the correct order would mean a lot of ...

JAXB unmarshal problem with XSD <choice> element

Hi, I'm experiencing a problem unmarshalling a element in an XML document using JAXB RI 2.2.1. The element is defined as follows (the full XSD is too large to post): <xsd:element name="PatternExpression" type="PatternExpression_Type"/> <xsd:complexType name="PatternExpression_Type"> <xsd:choice> <xsd:element ref="Pattern"/> <xsd:seque...

converting schema in XML to XSD for visual studio

Note, I am not trying to generate the schema for an XML file from the file. There is plenty about that on the web. Kind of a waste--how can a file fail validation if the validator was generated from the file it's validating? Anyway, I want to test an SSIS component that requires a configuration file in XML (not XSD) to tell it how to ...

Xml Schemas and Date Times

I'm beginning a new project which involves heavy xml and schema use accross multiple platforms (windows, windows mobile, Iphone, Ipad, and more which are yet to be discovered!). This xml platform has to be able to exchange date times from all over the world as our product is currently being implemented in Australia as well as in Canada ...

[C#] How to Validate XML Against Schema (XSD)? Something is wrong.

Hello, I do not know enough about the XML namespace to see my error. Do you? public static bool ValidateXml(string xml, string xsd) { try { // build XSD schema StringReader _XsdStream; _XsdStream = new StringReader(xsd); XmlSchema _XmlSchema; _XmlSchem...

Using xs:extension & xs:restriction together?

While writing an XML schema, I am attempting to do something like this <xs:complexType name="ValueWithUnits"> <xs:simpleContent> <xs:extension base="xs:double"> <xs:attribute name="uom" fixed="second"/> <xs:minInclusive="0"/> <xs:maxInclusive="10"/> </xs:extension> </xs:simpleC...

(FInite State Machine) - Implementing a XML schema validator in javascript

Hello, I have been working on a project for a month or so now to develop a XML validator (XSD) in javascript. I have gotten really close but keep running into problems. The only thing I have working well is normalizing schema structures into FSA that I store in the DOM. I have tried several methods to validate my xml structures agains...

How can I fix the web reference proxy that Visual Studio generated to handle jagged arrays?

It seems there is a known bug in wsdl.exe, the tool that Visual Studio uses to generate web service proxies. With certain XSD schemas the tool will generate classes that can't be deserialized from the XML. As far as I'm concerned that's unacceptable, but I don't know how to fix it. I will describe my case in detail, hopefully somebody...

Castor XML Marshalling - XSD Contains Choice

I have a schema element that reads as follows: <xs:complexType name="day-hours"> <xs:choice> <xs:element name="twentyfourhours"/> <xs:element name="closed"/> <xs:element name="hours" type="smm:hours"/> </xs:choice> </xs:complexType> <xs:compl...

How to create an XSD schema file from an XML file?

I am trying to create an XSD schema file from an existing XML file but am getting errors. Currently I am trying to use the XSD command prompt tool to generate the XSD file. Any advice on mistakes with my XML file? Or any other tools I should try instead? Here is my XML file: <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' ...

Creating a SINGLE XSD schema file from an XML file?

Is there a way to create just one XSD file from the below XML file? I have tried various tools but they all produce multiple XSD files. WHat is the cause of multiple XSD files? I need just one XSD file to load in SSIS. <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882' xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882' ...

JDOM to parse schema

Is it possible to parse an XSD schema into a JDOM tree? Or is there any other library (documentation required ;)) that could accomplish this? Thanks, ExtremeCoder ...

Using .NET to validate XML against a schema

I want to test (true or false) whether an arbitrary XML file matches a given schema. For what it's worth, the schema is the Word 2003 WordML schema, which Microsoft defines using a list of about 7 *.xsd files. One of these files also includes the W3C xml.xsd file, by including the following statement: <xsd:import id="xml" namespace="h...

how to specify at least one in a xsd:sequence

I have a sequence <xs:element name="XXXX"> <xs:complexType> <xs:sequence> <xs:element ref="YY" minOccurs="0" maxOccurs="unbounded"/> <xs:element ref="ZZ" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> but I would like that at least one element of YY or ZZ to be present, in ...

MAML (Powershell Help) XSD

I am generating MAML files for use with Powershell's Get-Help cmdlet. I would like to validate them. Can anybody tell me if there's a schema file somewhere that I can validate against? ...

Perl XSD parsing

Hi All I have a XSD file that is to be parsed and converted into a XML file. Is there any way to do it using Perl ??? After xml file is generated, i have to parse that xml file which is the second part, but i was struck in the first part of converting the XSD file to XML format. XSD is given below <?xml version="1.0" encoding="UT...

Reference an XSD file from different XMLs sitting in different project modules?

I have an XSD file that is referenced in three different XML files in different project modules using: <item-groups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="xml_schemas/item_groups.xml.xsd"> I have been trying to figure how to avoid manually copying the XSD into every module that needs it, s...

Defining XSD to validate groups of permitted XML attributes for the same element

I would like to define an XSD that would validate the following XML. <parameters> <param name="Maximum Error Threshold" type="integer">10</param> <param name="Auto Shutdown Timeout Duration" type="integer" unit="seconds">300</param> <param name="Flow Rate Adjusment" type="integer" unit="litrePerSec">0.5</param> <param na...