xml-schema

How to Create an XmlSchema instance from a String or an .xsd stored as a resource

I have an .xsd file stored as a resource in my vb.net project. I need to create an instance of the XmlSchema class using this resource. Any examples of creating an XmlSchema I can locate do one of the following: Create the xmlschema by adding elements and attributes manually like this example. Create the xmlschema using an XmlTextRea...

Generate XML file from database by XSD schema

I have database tables (SQL Server 2005/2008) and XSD schema which describes XML document. How can I generate XML document from database tables by this xsd schema? Thanks ...

XML Schema Validation: Identity Constraint Key?

I've been trying to build a pepXML to mzIdentML converter and using this validator to make sure my implementation is correct. Currently, I keep getting this error: "Validation error in file './files/test-test.mzid' line 24231 column 13: identity constraint key for element 'mzIdentML' not found" I can't figure out what this error eve...

Open XML - where did my Prefix Go?

Hi everyone. Please help with this if you can. Its very urgent and I can't seem to get my head around the problem. Note that I'm not a regular OpenXML developer. While debugging, the newly created element has its Prefix as w: , but the Xmldoc at the end loses it. The resultant InnerXML for the Element below is : <altChunk id="FF_HTML" ...

Beginner XML Schema: element with Attribute + Type

Hi. Lets take a look at my test .xsd: <!-- lot of stuff... --> <xsd:element name="root"> <xsd:complexType> <xsd:sequence> <xsd:element ref="target:child"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="child"> <xsd:complexType> <xsd:attribute name="childAtt...

I need an XML schema with an enumerated type which allows wildcarding.

I want to define an XML schema which allows elements like this: <Element>TYPE1</Element> <Element>TYPE2</Element> <Element>TYPE3</Element> <Element>Any Other Text</Element> In this case, TYPE1, TYPE2 and TYPE3 are enumerated strings. However, the schema also allows any text content in Element. This seems like a strange restriction. ...

JAXB and validation against parts of a schema with schemagen?

A very generalized and simplified scenario description: Application builds JAXB instances through UI, The JAXB instances are built in different steps are composed in the end, As this is done, I must perform validation of the JAXB instances created in each step against the XSD to verify that the UI tier does not build nonsense. Now t...

Where is the Word 2007 schema library stored?

Word 2007 allows XML schemas to be attached to a document (under the Developer toolbar | XML group | Schema button). Where is this schema library information stored? I have documents that I have created with custom XML tags based on a schema but when I pass on the document and the schema to someone else the schema is marked as unavailab...

Upgrading XML Schema programmatically

Hi all. I'm in the process of having to re-write a project due to the platform vendor needing the storage mechanism be in an XElement object instead of storing in data tables that I create in their database. It's becoming painful, and I need some insight. I can morph my object graph to/from Xml using the XmlSerializer and read/write t...

Python - Validation with multiple schemas using lxml

Hello, I'm working with a schema that was built by a third party and I'd like to validate it with lxml. The problem is that such a schema is split over different xsd files, which reference themselves. For example, a file called "extension.xsd" (which builds upon the "master" schema) has a line like: <redefine schemaLocation="master.x...

Generating multiple WSDLs for a WCF web service

Is it possible to get WCF to generate multiple different WSLDs for the same web service? The reason that I ask is that I want to generate a separate schema file for the classes and objects in my web service (this is in fact the default behaviour for WCF web services), however if I do this then some clients are unable to consume my web s...

XElement.GetSchemaInfo() is returning null, Why?

Hello all, I'm trying to validate an XDocument with a compiled schema that I have (which works) but when I try to access PSVI for the root XElement it returns null. I need this so I can validate child XElements. Here is a sample code of what I'm trying to do: XDocument xmlDoc = XDocument.Load(xmlFilePath); XElement root = _xmlDoc.El...

Does XML Schema Inheritance work in the same sense as OOP Inheritance?

I am working on a schema file that I intend to use with JAXB for a project of mine. In Java, I have the following sort of code structure public interface Condition { ... } public class AndCondition implements Condition { public AndCondition(List<Condition> conditions){ ... } } public class StateCondition implements Con...

JAXB inconsistency between 1 IDREF and more than 1

So I've been reading up on using IDs and IDREFs in JAXB here, and in the example presented they make use of 1 IDREF element, which appears as an Object in the generated Java code. I include both the XML Schema... <xsd:complexType name="CustomerType"> <xsd:sequence> <xsd:element name="id" type="xsd:ID"/> <xsd:element name="n...

app.config "Could not find schema information" after converting to Visual Studio 2010 / .Net 4.0

After upgrading my project to Visual Studio 2010 and .Net 4.0, my app.config file generates these messages upon building the project: Could not find schema information for the element 'supportedRuntime'. Could not find schema information for the attribute 'version'. Could not find schema information for the attribute 'sku'. Here is m...

semi colon delimited xs:attribute xsd

Hey, I'm currently building an XSD to validate some XML I'm working on, I'm guessing this probably isn't possible but I'm wondering if there is some way to enforce an attribute that is a ";" delimited list for example <nbsp style="cell-width:1.29;background-color:#99CC00;"/> similar to the way the style attribute works in html. Than...

XML Schema redefinition error

Hi, I'm trying to redefine the maxOccurs attribute of an element in a simple XML Schema using Eclipse's WTP plugin as my IDE. File: widget1.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema targetNamespace="http://www.example.org/widget" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="h...

Python 3.1.2 + Snow Leopard + lxml + XMLSchema

Hi folks, I'd like to use lxml library to validate XML Schemas in Python 3.1.2. Since the Snow Leopard MAC OS comes with the Python 2.6.1 installed, firstly, I downloaded the Python 3.1.2 automated installer at http://www.python.org/ftp/python/3.1.2/python-3.1.2-macosx10.3-2010-03-24.dmg and installed it. Secondly, I downloaded lxml 2...

need clarification regarding xml schema "all" tag (is this a libxml2 bug?)

When upgrading from libxml2 2.6 to 2.7, some behavior changed for me. I've located the bug report on their site that regards this change, its https://bugzilla.gnome.org/show_bug.cgi?id=571271 . Interestingly, they report that "and I guess we misinterpreted the expected behaviour of this options (though I'm still not 100% sure)" - they ...

Perl XML::LibXML::Schema will stop validation on first error

Hello, I'm trying to use the XML::LibXML::Schema to validate a xml file against a xsd. The problem is if my xml has multiple semantic issues the validation will die on the first one and not report the others. It finds the first error, no reference to <foobar/> bash-3.2$ ./test.pl test.xsd test.xml xmlfile <test.xml> failed validati...