xsd

Problem with DataSet schema interpreted from xsd

I have an xsd file which describes a DataSet schema I use to read/write my DataSet to disk as an xml file. I did not write the schema from hand, rather, I wrote the xml file by hand, inferred the schema from the xml file, and then wrote out the xsd schema. (I am pretty new to this...) Anyway here is the schema (some amazon.com stuff goi...

XSD string pattern independent of leading/trailing space

I have a XSD simple type that should match UUIDs: <simpleType name="UuidT"> <restriction base="string"> <pattern value="[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}" /> </restriction> </simpleType> It correctly matches the following content: <!-- valid --> <Uuid>12345678-1234-5678-9012-123456789012</Uu...

XSD problem: The value of attribute on element is not valid with respect to its type

(First of all, I'm trying to learn how to handle xsd files, I know very little) I got this xsd, and just copy to Eclipse IDE, and it says there an error on line 26: <xs:element name="Issuer" type="dkx:IssuerType" /> saying: cvc-attribute.3: The value 'dkx:IssuerType' of attribute 'type' on element 'xs:element' is not valid ...

XSD: Different sub-elements depending on attribute/element value

Another XSD question - how can I achieve that the following XML elements are both valid: <some-element> <type>1</type> <a>...</a> </some-element> <some-element> <type>2</type> <b>...</b> </some-element> The sub-elements (either <a> or <b>) should depend on the content of <type> (could also be an attribute). It would be so sim...

Add XSLT 2 schema to Visual Studio 2010 for intellisense

I'd like to add the XSLT 2 schema to Visual Studio 2010 to provide intellisense. I've added the schema to C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas (removing the XSLT 1 schema), but to no avail. The schema seems to have been parsed by Visual Studio, as I can hover my cursor over the namespace declaration in the stylesheet...

Store Metadata in XML Schema

hi i need to store additional metadata in a schema. simplified: <xs:schema> <xs:complexType name="CustomType" m:Representation="BlaBla">...</xs:complexTyp> </xs:schema> is it possible? i have seen somthing like that in ms-datasets they use an additional an attribute "msprop". but i've to see the source of urn:schemas-microsoft-...

Why my test xml is failing with very simple XSD Schema?

Hi all, I am a bit novice in xml schema. I would be grateful if somebody help me out to understand why my xml is not being validated with the schema: Here is my Schema: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/testSchema" xmlns="http://www.exam...

Validating XML with multiple XSDs in Java

Hello! I want to parse an XML file with Java and validate it in the same step against an XSD schema. An XML file may contain content of several schemas, like this: <outer xmlns="my.outer.namespace" xmlns:x="my.third.namespace"> <foo>hello</foo> <inner xmlns="my.inner.namespace"> <bar x:id="bar">world</bar> </inner>...

Special Characters Restriction Rule in XSD

hello how do i,restrict special characters in my XSD validation , i am able to handle , some characters with this pattern "([a-zA-Z0-9_.' !@#$%^*()_+={}|/:;,>?/`~ ])+" but not able to handle below : " & ' < \ ® ™ any ideas ? also not able to handle them with [^] pattern ...

Multiple schema validation in Java

Hi, I am trying to do multiple schema validation in Java. I don't understand where I am doing wrong. Any help will be appreciated. abc.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xn="project-xml-r4j_another.xsd"> <xsd:import namespace="project-xml-r4j_another.xsd"/> <xs...

xsd element with the same name

to make xsd for element with same names that only identifyed by attribute value example :- <a> <b n="structure one"> <c n="inner element 1"/> <c n="inner element 2"/> <c n="inner element 3"/> </b> <b n="structure two"> <c n="inner element 1 for structure two"/> <c n="inner element 2 for structure two"/> <c ...

How can i tell jaxb / Maven to genereate multiple schema packages?

Example: </plugin> <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.7.1</version> <executions> <execution> <goals> <goal>generate</goal> </goals> </ex...

create XSD for element with same name

how to make xsd for element with same names that only identifyed by attribute value example :- <a> <b n="structure one"> <c n="inner element 1"/> <c n="inner element 2"/> <c n="inner element 3"/> </b> <b n="structure two"> <c n="inner element 1 for structure two"/> <c n="inner element 2 for structure two"/> <c n="inner element 3 for str...

xs:key, why is validation passing when key value is not member of key reference?

Hello SO, I am interested in defining a key constraint in my Xsd. It is my understanding that using xs:key should constrain the value used to a member of a referenced list of values. Assuming we are using the sample Xsd, <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="namespace1" xmlns:r...

Question regarding xsd

I have an application which reads the data from the database, creates an object out of the data, marshalls it into an xml and enqueue the xml to a queue which is producer. The xml is dequeued from the queue by a consumer. I need to use xsds at two different places. For database access while reading the data from the database and ...

XML Schema: How to specify an attribute with a custom 'simpleType' type?

In my XML schema definition, I'm trying to restrict the value of an attribute to be an integer between 0 and 100. With reference to the sample schema below, I want attribute 'attr' on element 'root' to have this restriction. To achieve this I define a simpleType 'Percentage' and set this as the 'type' of 'attr'. However, my XML schema ...

VS 2010 migration issue – XSD.EXE can’t process Framework 4.0 assemblies

In VS 2008 / SDK 6.0 I used the /t option of the XSD utility to automatically generate XSD files from existing assemblies / classes. With VS 2010 and SDK 7.0 this isn’t working any longer, because the XSD.EXE can’t process the new Framework 4.0 assemblies. It stated to be a Framework 2.0 tool and can’t process assemblies of newer runtime...

How to create an xml schema with key/keyrefs for nested elements of the same type

I work with some XML files on a regular basis and want to have better validation then a DTD can provide. So I started reading about schemas to see if would help me out. So far I've been able to create something that works almost like I need except for one piece. I want to be able to restrict the attribute of an element to the values of a...

In generated code, how to access the facets declared in the XSD file ?

Hi, What I thought was going to be a simple problem turns out to be quite a head scratcher. I am currently using JAXB 2 to generate code from an XSD on which I have no control. I need to access the constraints from the schemas so I can apply some logic and guard code when setting values in these objects. Validation in bulk simply will...

Does XSD allow simpleContent and complexContent at the same time?

I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like: <value><int>123</int></value> <value><boolean>1</boolean></value> But at the same time it requires: If no type is indicated, the type is string. Which means i could receive something like this: <value...