xsd

XSD Validation of XML file having non-deterministic occurance of elements.

The following XML snippet is parsable using standard XML lib (tried with Java and Scala). <?xml version="1.0" encoding="UTF-8"?> <list> <a>value1</a> <b>value2</b> <a>value3</a> <a>value4</a> <a>value5</a> <b>value6</b> <b>value7</b> </list> As you can see 'a' and 'b' elements are mixed (non deterministic). Is it possible to write a X...

XSD parser algorithm

Hi, I am working on an autocomplete plugin for xml documents. I want to know if there are any recommended algorithms to which I could refer to parse through the xsd?? The idea is to parse through xsd and construct a collection/hash of objects and then suggest the next level sub tags on < and attributes on space inside <>. Edit: The lan...

How can I validate XML with XSD in Perl?

This may be a simple question for most Perl programmers, I have only used Perl for two weeks so far and am very unfamiliar with the Perl packages. I have a simple XSD file as below: <?xml version="1.0" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema"> <xsd:element nam...

Do you know of a tool to turn an XSD definition of how classes will be marshalled to XML into a class diagram (UML?)?

I've been given an XSD file that describes how objects will be marshalled into XML. The XSD is complex enough that I can't keep it all in my head while trying to write some code to parse it (with SAX). What I'd like is some sort of tool that could turn this XSD definition into a class diagram. Do you know of any? Bonus points if it'll ...

.Net adding Min\Max lenght to field attribute?

Hello and thanks for any assistance. I have a WCF project that contains a Customer class object. Currently, I use svcutil to generate the WSDL and XSD's that I give to the client. When the XSD's are generated they are pretty simple. For some of the fields I want to add Min and Max Length Attributes, so that the XSD has the <xs...

XML Deserializer / XSD tool / object arrays

I have an XSD, and used the xsd.exe tool to create c# classes. In a webservice I am accepting in the MessageContract an instance of one of these created objects. The relevant portion of the xsd to this question is here: <xs:element name="Tasks"> <xs:complexType> <xs:sequence> <xs:element ref="Task" maxOccurs="un...

Are there any supporting resources for schematron? any tutorials-tools etc ..

Hello .. I am interested to learn Schematron .. Please suggest me a tutorial to practice (I am expecting a complete tutorial where I can develop my skills,, well. I already know the basics of DTD, XSD and XSLT ..) .. I have tried using Zvon tutorials and Schematron.com, And also ... I have been struggling to find the schematron-edito...

How to validate a Gateway entry in classic XML/XSD/XSLT ?

Hey they, I am currently working on a application dealing with a XML file. The XML file looks like this : <config> <ip>10.10.100.2</ip> <subnet>255.255.0.0</subnet> <gateway>10.10.1.1</gateway> </config> Now I am on validation. I use XSD. So my validation works fine with the IP element and Subnet Element. I done something like this...

Most Efficient Schema For This OR That, or This AND That

I'm trying to write an XML schema that allows XML to be expressed in the following ways: pets can containt both cat and dog elements: <root> <pets> <cat /> <dog /> </pets> </root> pets can contain just cat or dog elements <root> <pets> <cat /> </pets> </root> ----------- <root> <pets> <dog /> </pets> </ro...

XML Schema - child elements dependant on existance of optional attribute

Is it possible to define in XSD the following scenario: Parent element has an attribute that is optional. If the attribute is not present in XML, at least one child element must exists. If the attribute is present, there can be zero or more child elements. Example: VALID <parent external-source="some_name" /> <par...

XSD: Define an element with any name

Because of limitations of certain systems, we need to use XMLs that are formatted a bit inconveniently. Those we need to transform into a convenient form. The question: how do I define in an XSD schema an element that has the following properties: Does not have any children Does not have any attributes Has any name (that is what...

XSD: How to redefine the data type of a simpleType eg. from xs:string to xs:integer

I am trying to extend and tailor an external xsd schema (of the fixml standard). I need to change the data type of some of the elements, without touching the original schema, but by redefining it; but have been finding it exceedingly cumbersome. What exists: fields-base.xsd <xs:simpleType name="LastUpdateTime_t"> <xs:restr...

getting the minOccurs attribute using XSOM from an element

How do I get the minOccurs attribute off of an element using the XSOM parser? I've seen this example for getting the attributes related to a complex type: private void getAttributes(XSComplexType xsComplexType){ Collection<? extends XSAttributeUse> c = xsComplexType.getAttributeUses(); Iterator<? extends XSAttributeUse> i = c.it...

Best Practice Using C# XSD typed-datasets In Enterprise Applications

Hello, I'm trying to understand what is the best practice using XSD tables generated from the Database scheme that I currently use. 1) Do you think the XSD information should be located as part of the Model? 2) Does it mean that Data Access Layer returns Datasets and other generated objects? 3) Does it goes through all the system lay...

SPARQL xsd:dateTime equality

I have a SPARQL query: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#&gt; PREFIX person: <http://www.myOntDomain/person#&gt; PREFIX likedEvent: <http://www.myOntDomain/likedEventRule#&gt; PREFIX event: <http://www.myOntDomain/event#&gt; PREFIX owl: <http://www.w3.org/2002/07/owl#&gt; PREFIX xsd: <http://www.w3.org/2001/XMLS...

c# best way to grab a xsd from a referenced project

My application references another a project which has an XSD file in it. Whats the best way to get that XSD? I did a bit of googling and found suggestions like load the assembly and get it from that, is there no easier way? Can anyone help? Cheers, Andy ...

XML Schema order indicators confusion

I've been studying up how to write an XML Schema and I'm stumped on XSD ordering indicators like xs:sequence, xs:all, xs:choice. There seem to be only 3 of them and they're required in complex types. But what if I have the XML like the following: <row> <name>John</name> <city>LA</city> <country>France</country> </row> In w...

XSD: XML files pass validation, but so do XSLs and XSDs

So there's an XSD schema that validates a data file. It declares root element of the document, and then go complexType's that describe structure. The schema has empty target namespace, document nodes are not supposed to be qualified with a namespace. Recently someone by mistake sent an XSL template in place of an XML data file. That xsl...

Restricting attributes of a XSD element when within a different element than normal

In my XSD file I have an alement 'row' of type 'rowType'. When places within another element 'frozen', I would like to restrict the type of 'row' to a subset of 'rowType's allowable values. Does anyone know how to do this? Thanks. ...

Does anyone have an XSD for Media RSS?

I realize there is no official one and I have the latest XSD that is posted to the http://tech.groups.yahoo.com/group/rss-media/ group. I am wondering if anyone reading this has generated a working XSD off of the most recent spec (1.5)? http://video.search.yahoo.com/mrss ...