xml-schema

Defining pattern of text() node of complex mixed element

This question is related to that one. But somewhat extended. Let's assume we have an xml: <field name="test_field_0"> Some text that is texty text. <subfield>Some text.</subfield> </field> The Scheme for it from related question: <xs:element name="field"> <xs:complexType mixed="true"> <xs:sequence> ...

jQuery XML parsing with namespaces

I'm new to jQuery and would like to parse an xml document. I'm able to parse regular XML with the default namespaces but with xml such as: <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema"> <s:Schema id="Ro...

XML Schema testing a value and applying extra restrictions

Hello all! I have the following case: All boats have a boat type like shark , yatch and so on. I need to register which type of boat name and also how many feet the boat is, but this is where the problem arises. If the user types in a shark I need to validate that its between 15-30 feet, if he type in a yatch it needs to be between 30-...

Insert XML node at a specific position of an existing document

Hi, I have an existing XML document with some optional nodes and I want to insert a new node, but at a certain position. The document looks something like this: <root> <a>...</a> ... <r>...</r> <t>...</t> ... <z>...</z> </root> The new node (<s>...</s>) should be inserted between node <r> and <t>, resulting in: <root> ...

SQL 2005 XML Schemas - Defining a Unique Attribute

Here's a Sample xml document I'm trying to create a schema for: '<Fields> <Field ID="-1">somevalue</Field> <Field ID="-2" /> <Field ID="-3" /> <Field ID="-4">Some other value</Field> <Field ID="-5" /> </Fields>' I'm trying to create a SQL Server 2005 schema collection to: 1. prevent dupicate id's. 2. only allow negative ids....

XML design - How to?

We are currently working on the design of a RESTful application. We have decided on XML as our basic representation. I have the following questions regarding designing/modeling the application data in XML. What are the approaches towards data modeling in XML? Is it a good idea to start from scratch and then evaluate the use of standar...

Usage of XSD occurrence Indicators

XML Schema specifies "occurrence indicators" (maxOccurrence, minOccurrence). Is there a "best pratice" in which elements (xsd:element, xsd:sequence or xsd:all) these indicators should be used? Example: either <xsd:element name="XList"> <xsd:complexType> <xsd:sequence> <xsd:element name="X" type="xsd:token" minOccurs="...

Can I use xsd:complexContent with the Delphi XML Binding Wizard?

The Delphi 2009 XML Data Binding Wizard fails to process a simple XSD which contains a complexContent declaration (Invalid Pointer Operation). Is it a bug or a know limitation? Example: <?xml version="1.0" encoding="utf-8"?> <xsd:schema targetNamespace="http://example.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementF...

Convert xml to xsd using java

I am looking for a tool or java code or class library/API that can generate XSD from XML files. (Something like the xsd.exe utility in the .NET Framework sdk) ...

How to display xml response already formatted in html (IE won't show anything after the xml table)

How to display xml response already formatted in html (IE won't show anything after the xml table) If you visit this page in IE you'll see that nothing displays after the chart: http://www.ratecatcher.com/prototype.htm Here is the main php code: $xml = file_get_contents($request); echo html_entity_decode($xml); Then the html that is...

JAXB List of Choice

I have following schema <complexType name="BookShelf"> <sequence> <element name="newBook" type="string" minOccurs="0" maxOccurs="unbounded"/> <element name="oldBook" type="string" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> XJC generates BookShelf class with two lists, one for newBook and one for...

XSD key/keyref: hierarchical key structure

I'm trying to define some foreign key constraints on an XML schema using xs:key and xs:keyref definitions. I want the structure of the document to be hierarchical in the following way: <?xml version="1.0" encoding="UTF-8"?> <tns:root xmlns:tns="http://www.example.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLoca...

How do I validate an XML file against a Schema using ant?

As part of my build process I want to validate XML files against a Schema (XSD). I'm trying to use the schemavalidate task like this: <schemavalidate noNamespaceFile="schemas/Model.xsd" file="Model.xml"/> This yields the following error: [...] BUILD FAILED build.xml:65: The following error occurred while executing this line: build.x...

When should I use xml schemas(.xsd) when reading xml?

Hi, I have a XML file which holds configuration data for data sources, and the related queries held in 'dataseries' elements. As I don't really need domain objects made up from the XML, rather just settings read and used to configure connections etc. I was wondering if there is any advantage in using the XML schema I have defined? I a...

XML data structure like 'Multiple selection'

Hello. I wonder how i could easily describe Multiple selection combobox using XML and Schema. Currently iam using this definition: <xs:element name="RefPartner"> <xs:complexType> <xs:attribute name="isSalesRepresentative" type="xs:boolean"/> <xs:attribute name="isPolicyResponsible" type="xs:boolean"/> <xs:attribute name="isPolic...

How to generate Pascal code from an XML schema in Delphi Prism?

I need to import some XML schemas. In Delphi, I would use the the XML Data Binding Wizard to generate the Pascal code from the schemas. Is there something like that in Delphi Prism to avoid writing all this boilerplate code? ...

How to name a class generated by JIBX through codegen

I have an XML schema that has an element named Con, unfortunately con is an illegal file name on windows so when I use codegen to generated java classes it fails. What I'm trying to do is get JIBX's codegen to rename the class but it doesn't seem to work. This is JIBX 1.2.1 Example schema: <?xml version="1.0" encoding="UTF-8" ?> <xs:...

Generating a WSDL from a xsd file

Hi, I need to generate a WSDL file given a xsd file. How do I do this? Can I do this in VS2005? What is the simplest way to do this? Cheers! Ausgar ...

how to reference XSD Schema location while parsing XML Doc via SAX Xerces?

how to reference XSD Schema location while parsing XML via SAX Xerces? < ?xml version="1.0" encoding="ISO-8859-1"?> < com.firma xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > < !-- xsi:noNamespaceSchemaLocation="F:\...\myschema_v2.5.xsd" Must I reference this element really within the XML Doc??? I hope, not... ...

How can you make a sequence of optional items which must be in order in an XML schema?

What I want to do is create a sequence element in an XML schema such that the contents must be in order, but may not all be present. For example, the schema would be something like this: <xs:element name="rods" maxOccurs="1" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="green" type="xs:positiveInteger" /> <xs:...