|  |  |  | License Codehaus OpenEJB OpenJMS OpenORB Tyrex
Old releases
General
Release 1.3
Release 1.3rc1
Release 1.2
Main
Home
About
Features
Download
Dependencies
Reference guide
Publications
JavaDoc
Maven 2 support
Maven 2 archetypes
DTD & Schemas
Recent HTML changes
News Archive
RSS news feed
Project Wiki
Development/Support
Mailing Lists
SVN/JIRA
Contributing
Support
Continuous builds
Prof. services
Related projects
Spring ORM support
Spring XML factories
WS frameworks
XML
XML
XML Code Generator
XML Code Generator
JDO
Introduction
First steps
Using JDO
JDO Config
Types
JDO Mapping
JDO FAQ
JDO Examples
JDO HOW-TOs
Tips & Tricks
Other Features
JDO sample JAR
Tools
Schema generator
Advanced JDO
Caching
OQL
Trans. & Locks
Design
KeyGen
Long Trans.
Nested Attrs.
Pooling Examples
LOBs
Best practice
DDL Generator
Using DDL Generator
Properties
Ant task
Type Mapping
More
The Examples
3rd Party Tools
JDO Tests
XML Tests
Configuration
About
License
User stories
Contributors
Marketplace
Status, Todo
Changelog
Library
Contact
Project Name
## How to marshal XML documents with version 1.1 Intended Audience Context Configuration ## Intended Audience Anyone who wants to use Castor XML for XML data binding, namely marshalling operations, and produce XML document instances that carry a the version 1.1 in the XML preamble. ## Context Before release 1.3.2, Castor was able to produce XML documents upon marshalling that had the following XML preamble (if not omitted on purpose) only:
    <?xml version="1.0" encoding="UTF-8"?>
    <foo/>
With the release of the XML document standard version 1.1, it was necessary to add an option to have the following preamble generated:
    <?xml version="1.1" encoding="UTF-8"?>
    <foo/>
## Configuration To make Castor output version `1.1` in the XML preamble as produced upon marshalling an object instance to XML, the `org.exolab.castor.xml.version` property has to be overriden in a custom, user-specific `castor.properties>` file.
    org.exolab.castor.xml.version=1.1
Alternatively, you can set the property directly on the `XMLContext` instance using ...
    XMLContext.setProperty(XMLProperties.XML_VERSION, "1.1");
before creating Marshaller instances from the `XMLContext` instance using `XMLContext.createMarshaller()`.
| Copyright © 1999-2005 ExoLab Group, Intalio Inc., and Contributors. All rights reserved. Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners. |