xml-schema

Which one is better for schema to code generation, XMLBeans or JAXB?

Want to use a library for XML schema to code generation and wanted to know if people have a preference between XMLBeans and JAXB. Performance, Schema validation capability, Memory Usage.. Any indicators will help.. ...

XML attribute ordering of namespaces

A related question to one I asked earlier... Just checking on something: Should the order of the xmlns, xmlns:xsi and xsi:schemaLocation attributes in an XML file matter? I'm finding that it does - at least when using XML Notepad 2007 to view the XML file. For example (assuming that my XML file is legal according to my schema) this gi...

How modular should be a XML schema?

Hello everyone! Talking about schema definitions, what are you used to doing: put everything inside a unique and big bang XML schema? use a domain modularization approach, putting all entities that referes to the same context together? or just use a schema per entity? I´ve read in a best practice document from a famous/private integ...

How do I translate XML from one schema to another?

I want to translate xml documents with a certain schema into another schema. I know both the old and new schemas... I am planning to use python's xml.dom library , and translate line by line. Any ideas on how to go about it ? Any tools or libraries in other languages that might make this easier/more efficient. Thanks! ...

XSD validation

Can anybody help me to build an XSD file to validate XMLs like these: [test] [a/] [b/] [a/] [b/] [/test] [test] [a/] [a/] [b/] [/test] Basically, I can have any number of and/ or nodes, without any other rule (can't use ). Thanks. ...

How to specify format of XML output when writing from a DataTable?

In C#, I'm creating an XML file from a DataTable using dataTable.WriteXml(filePath), and get the following: <?xml version="1.0" encoding="utf-8" ?> <ExperienceProfiles> <ExperienceProfile> <Col1>blah</Col1> <Col2>4ed397bf-a4d5-4ace-9d44-8c1a5cdb0f34</Col2> </ExperienceProfile> </ExperienceProfiles> How can I get it to writ...

Proper use of HTTP status codes in a "validation" server

Among the data my application sends to a third-party SOA server are complex XMLs. The server owner does provide the XML schemas (.xsd) and, since the server rejects invalid XMLs with a meaningless message, I need to validate them locally before sending. I could use a stand-alone XML schema validator but they are slow, mainly because of ...

XML Schema: Element with attributes containing only text?

I'm having difficulty searching for this. How would I define an element in an XML schema file that looks like this: <option value="test">sometext</option> I can't figure out how to define an element that is of type "xs:string" and also has an attribute. I'm fairly new to writing XML schemas, so please bear with me! Here's what I've g...

XML Schema: Element that can contain elements or text?

How would I define an element that can either contain plain text or contain elements? Say I wanted to somehow allow for both of these cases: <xs:element name="field"> <xs:complexType> <xs:sequence> <xs:element ref="subfield" minOccurs="0" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="name" type="xs...

Ambiguous XML schema

Hi, I'm trying to produce a pretty simple XML schema for an XML similar to the following: <messages> <item> <important_tag></important_tag> </item> <item> <important_tag></important_tag> <tag2></tag2> </item> <item> <tag2></tag2> <tag3></tag3> </item> </messages> The idea is that <important_tag> will h...

Force use of CDATA in XML-schema

I am creating an xml schema, and I want to make sure that the values in all the elements are CDATA elements. Is there a way to force this using XML-schema? ...

Custom date format in XML-Schema

I am creating an xml schema, and I want to support a custom date format: Thu Dec 11 14:17:20 2008 Currently I'm using the following pattern type: <xs:simpleType name="Date_Type"> <xs:restriction base="xs:token"> <xs:pattern value="(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|June|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]{2} [0-9]{2}:[0...

tool to create objects from XML Web Service Schema

Hi guys, I work a lot with external Web Services, and I need to create an object (class) based on that document, so I can use that object across my web application. My question is simple, is there a way that I can create/generate an object using only the XML provided from the schema? kind'a wscompile tool Would save a lot of hours to...

How to declare special XML schema (XSD) case - need help

I need your help to define a special case in XML schema: A sequence that contains two elements: 'x' and 'y' whereas: 'x' element can appear 0 to unbound times in the sequence 'y' element can appear 0 to 1 time in the sequence 'x' and 'y' locations can be anywhere - that is, it is possible to have unbound times the 'x' element and then...

Writing an XmlSchema to a MemoryStream fails with an exception while runing from Nunit

Hi, I'm trying to convert an XmlSchema object to string. I'm building a simple XmlSchema, compiling it, and then converting it as folows: public string ConvertXmlSchemaToString(XmlSchema xmlSchema) { String SchemaAsString = String.Empty; // compile the schema XmlSchemaSet schemaSet = new XmlSchemaSet(); ...

XSD - How to describe an unordered set of element types where the first element must appear first in the sequence?

This is an XML schema question. I know that xsd:all element can't appear in a sequence (must be the top level element of its type). That is, I cannot use the following: <xsd:complexType name="Application"> <xsd:sequence> <xsd:element ref="Name"></xsd:element> <xsd:all> <xsd:element ref="ADD"></xsd:element> <xsd:...

XML and Sql Server 2005

Hi, i have a problem that I want to resolve in a best possible way. The thing is that I made a schema that looks like this: print(" <xs:complexType name="rentACarT"> <xs:sequence> <xs:element name="poslovnice" type="poslovniceT" /> <xs:element name="korisnici" type="korisniciT" /> </xs:sequence> </xs:complexType> <xs:...

relationship beween subclasses in XML

i just want to know how to define relationship between subclasses in XML i.e a class researcher has two subclass Paper and author . ...

XML Relationship

I am unable to define a relationship between paper and author. Is it possible to define one? <xsd:complextype name="Researcher'> </xsd:complextype> <xsd:complexType name = "Paper" > <xsd:extension base = " Researcher " > </xsd:extension> </xsd:complexType> <xsd:complexType name = "Author"> <xsd:extension base = " Res...

Extending XHTML

I'm playing around with writing a jQuery plugin that uses an attribute to define form validation behavior (yes, I'm aware there's already a validation plugin; this is as much a learning exercise as something I'll be using). Ideally, I'd like to have something like this: Example 1 - input: <input id="name" type="text" v:onvalidate="retu...