xml-schema

A problem with the usage of recursive XML schema types

It is easy to define two elements with the same name like <any> in one XML schema and different permitted subelements. One should just declare two XSD types AnyType1 and AnyType2 as complexTypes which describes permitted subelements. Then one can declare element <any> in one context as <xs:element name="any" type="AnyType1" /> and as <xs...

Extending a element in the XML Schema

Hello guys! I'm trying to extend a element in my XML Scheme, but its not working: <xs:complexType name="instituicaoComPais"> <xs:complexContent> <xs:extension base="instituicao"> <xs:sequence> <xs:element ref="pais"/> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name=...

Choosing framework for XML persistency

I need to choose a framework for XML persistency of some java classes in our application. My requirements are: 1. I start from java classes, not from schema 2. Using annotations for customization 3. Ability to generate schema. Until now only JAXB seems to satosty all my requirements. XStream does not generate schema JiXB dows not use j...

JAXB SchemaFactory source order must follow import order between schemas?

Using latest JAXB (Sun) and have a hierarchy of schemas that use import directives between schemas to share type definitions. Schema validation is activated on the setSchema call to Marshaller/Unmarshaller in JAXB which should defer validation to Xerces (using Java 1.5). I don't want to know the order of import directives between schem...

XML Schema file, explain ?

Hi XML Professionals, This is part of one of our XML files in SharePoint: <BuildManifest nsprefix ="ns0" ns="http://tempuri.org/Eform_Schema.xsd" version="1.1"> <IdentifyInputParameters> <BusinessObject ref="Request1" type="RequestProcessing_BL.Request" /> </IdentifyInputParameters> <Metadata> <So...

How can I validate a partially(Part of it) generated XML against a XSD?

I m generating an XML document using objects. Batch object encloses all other childelements and i want validate the partially generated XML Document against XSD. If I assign null value to any inner complexType. The validation fails because the inner elements won't appear in the XML document. For example, if XSD contains Address as a comp...

(Java) How can I pass Schema-validated XML documents as parameters between distributed components (e.g. web services or sockets)?

Here is a description of the scenario and I would appreciate also any comments on the approach used The core of my application is a set of web services backed by a P2P database. One service accepts a simple XML-based record (I have designed a generic schema for it). The service processes this data (mainly creating keys based on certain ...

XmlReader.Create(textReader, XmlReaderSettings) Validation Issue

For the most part, when I perform an XmlReader.Read() I am catching validation errors based on my schemas. This, however, is a large group of schemas with several imports and includes. My question is why I'm having validation errors in two places that seem to be defined in the schema. Here's an example: Schema 1 (you can see that Ide...

XSD Validation Errors localization

Hello! I have a quick question: Is there a "language pack" for XSD validation errors? I have my application's culture set to Spanish but when I validate a XML file against XSD I get the messages in English... Thanks! ...

Why should you use XML CDATA blocks?

When creating XML I'm wondering why the CDATA blocks are uses rather than just escaping the data. Is there something allowed in a CDATA block that can't be escaped and placed in a regular tag? <node><![CDATA[ ...something... ]]></node> instead of <node>...something...</node> Naturally you would need to escape the data in either cas...

NetBeans: How to provide offline XML schemas?

I would like to have the code completion and XML validation that comes from NetBeans having access to the schemas referenced in XML documents. Unfortunately I need to use NetBeans in an offline (completely disconnected from the Internet) location, meaning NetBeans fails in downloading the referenced .xsd files. However, I have all of t...

XSL / Schemas beginners question

Been using XML for ages now for data storage & transfer, but have never had to validate or transform it. Currently starting a new project and making some design decisions and need to know some rudimentary things about XSL & Schemas. Our XML is like this (excuse the boring book example :) ): <Books> <Book> <ID>1</ID> <Name>Boo...

Official XHTML 1.1 DTDs vs. official XHTML 1.1 XML Schemas

I have the option of validating XHTML 1.1 documents against the official XHTML 1.1 DTDs (I use the plural because the "main" DTD actually includes several others) or against the official XHTML 1.1 XML Schemas. Now I know that the XML Schema language is more expressive and powerful and can therefore check for more things. What I'm wonder...

Best/most portable way to version a file format

Hello SO, This question concerns XML schemas and files. Suppose I am developing a desktop application with a file-based interface, i.e. the user stores their progress in a file on disk - pretty standard for the vast majority of productivity applications and many more besides. The file is fundamentally XML, whose schema is stored by som...

Automatic editor of XML (based on XSD scheme)

Is there any approach to generate editor of an XML file basing on an XSD scheme? (It should be a Java or Python web based editor). ...

Marshall abstract class without its type definition

I try to achive the opposite of here. I have an abstract class, but I do not want the abstract class' type and tag to be outputted. So I need an output, which basically looks like <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <dokument ausgabe="ausgabe_test.doc" vorlage="vorlage_test.dot"> <marke typ="text" name="test"> ...

DataSet ReadXmlSchema ignoring precision and scale

I have a very simple XML schema I am trying to read into DataSet. When I read the schema file, the DataSet ignores the totalDigits and fractionalDigits restrictions. The string's max length restriction is respected, but I can't get it to acknowledge the decimal restrictions. Here is the xsd file: <?xml version="1.0" standalone="yes"?> <...

Defining element references in an XSD

How would one write an xsd to represent the xml shown below (taken from http://static.springsource.org/spring-ws/sites/2.0/reference/html/why-contract-first.html)? <flight number="KL1117"> <passengers> <passenger> <name>Arjen Poutsma</name> <flight href="KL1117" /> </passenger> </passengers> </flight> In this c...

Xml schema - define child elements 0-* in any order

I want to define a xml schema where the element Connectors have 0-* child elements. Either Sequence, Association or Message in any order and 0 to many times. I.e. <Connectors> <Sequence /> <Association /> <Message /> <Sequence /> <Sequence /> <Message /> <Message /> <Association /> </Connectors> I tried...

JiBX: Creating a marshaller for non-global elements?

So we have a given XSD such as this: <xsd:element name="SomeRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="RegistrationDetail" type="RegistrationDetailType" minOccurs="0" /> </xsd:sequence> </xsd:complexType> </xsd:element> <...