xmlbeans

How to insert XmlCursor content to DOM Document

Some API returns me XmlCursor pointing on root of XML Document. I need to insert all of this into another org.w3c.DOM represented document. At start: XmlCursor poiting on <a> <b> some text </b> </a> DOM Document: <foo> </foo> At the end I want to have original DOM document changed like this: <foo>   <someOtherInserte...

Java XML Binding

What are you using for binding XML to Java? JAXB, Castor, and XMLBeans are some of the available choices. The comparisons that I've seen are all three or four years old. I'm open to other suggestions. Marshalling / unmarshalling performance and ease of use are of particular interest. Clarification: I'd like to see not just what framewor...

Importing and using external schema using XML Beans

Hello, I have a bit of a problem. I wrote an API a long time ago for our production system, and it used Apache XML Beans. The schema was homogeneous (ie no imports, everything was from within the same schema), and everything worked just fine, even if the code for API handling was incredibly verbose. I've since written a far simpler a...

How to get all Enum values in XMLBeans?

Hello Apache XMLBeans can be used to generate Java classes and interfaces from XML Schema Definition files (XSD). It also generates Enums based on StringEnumAbstractBase and StringEnumAbstractBase.Table to represent domain values. They are handy for entering only valid values. However, I want to get all those values to generate a JCombo...

Mapping XPath 1.0 data types to java

I'm using XPath 1.0 to process incoming web services messages. This can be quite hard to get right if schema data types are used, because XPath 1.0 does not recognize them (XPath 2.0 does, but there seems to be no full open source implementation. Not sure if Saxon-B does this). E.g., the literals "true" and "false" in a xs:boolean repr...

xmlbeans - set content of a complex type

My xsd file contains: <xs:sequence> <xs:element name="Book"> <xs:complexType> <xs:attribute name="author" type="xs:string" /> <xs:attribute name="title" type="xs:string" /> </xs:complexType> ...

Saxon XMLBeans Tomcat

We recently updated our Tomcat web service. The only things we really updated were that we updated XMLBeans to version 2.4 and Saxon to version 9. Running it Netbeans and eclipse, our project now works fine, but when trying to deploy to tomcat we get the following. We tried updating JAXEN to version 1.1.1 but no joy. Any ideas? Th...

order of parsed elements is lost in XMLBeans

I have a XML structure somewhat like this: <root> <a/> <b/> <b/> <a/> <a/> </root> My XSD looks like this: <xs:element name="root"> <xs:complexType> <xs:sequence> <xs:choice maxOccurs="unbounded"> <xs:element ref="a"/> <xs:element ref="b"/> </xs:c...

How to get line number information from XMLBeans' XMLError

The subject basically says it all. XmlBeans' XmlError.getLine() always returns -1. Is there any way to get at least an approximate position for an error? I have already tried the XmlObject, but since whitespace, quotes, et al. are stripped or changed, that's not much help. ...

Using XMLBeans on Andoid

Hi Everyone. I was just wondering if anyone had any success in getting XMLBeans (or any other generator) to work on android. It would be very nice if I could use it because I have a very large schema that I would rather not write all the classes by hand. I had asked about this on the android developers mailing list, but no one responded...

RuntimeException from xmlbeans - can't find compiled schema

I'm getting a RuntimeException while executing some code that depends on generated xmlbeans classes. I can't figure out if this is: me missing something during code-generation or packaging a runtime dependency missing a misleading error message, and I should be looking elsewhere. The xbean.jar version is the same in the build and exe...

Using xmlbeans bindings for cxf wsdl2java

I am getting started with using apache CXF 2.1.5 and xmlbeans to generate a web service client. The FAQ page shows how to use jaxb bindings to have java.util.Date binding for xsd:dateTime: <jaxws:bindings wsdlLocation="YOUR_WSDL_LOCATION" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns:xs="http://www.w3.org/20...

What does the org.apache.xmlbeans.XmlException with a message of "Unexpected element: CDATA" mean?

I'm trying to parse and load an XML document, however I'm getting this exception when I call the parse method on the class that extends XmlObject. Unfortunately, it gives me no ideas of what element is unexpected, which is my problem. I am not able to share the code for this, but I can try to provide more information if necessary. ...

Are there any tools similar to XML Beans for 834 files in JAVA

I love the pleasure of dealing with XML files with XMLBeans objects... Now working with 834 files, i wonder if its a similar tool for 834 files A flat file object will be helpful also thanks Chung ...

Can you modify XML schema after it has been read in to xmlbeans?

After reading in a schema with xmlbeans, is it possible to make modifications to the schema (in the xmlbeans model)? ...

Can I get an XmlObject instance if I have its corresponding SchemaType object?

In XmlBeans, I have a compiled schema and I create an instance through the MyStuff stuff = MyStuff.Factory.newInstance() method. But in a part of my application I need to treat MyStuff as a generic XmlObject and yet I want to create instances of it. Suppose that I want to do: workWithObjectsAbstractly(stuff) where workWithObjects...

Create and fill an xml document with xmlbeans

Hello, Some time ago, I was using XmlBeans at work and had to create programmatically an xml from a schema. Back then, I compiled the schema using XmlBeans and then used some XmlBeans functionality (I cannot recall its name right now) to create a valid xml which had all the optional and required tags and attributes. I am leaving this q...

Accessing XMLBeans generated schemas.jar in Maven project

I have a schemas.jar supplied to me and am trying to access it from within a simple Maven project. I have put the schemas.jar file in my src/main/resources directory, which is in my classpath. When I am trying to access the created documents with something like: GetOrdersRequestDocument getOrdersRequestDocument = GetOrdersRequestDocum...

XMLBeans - xsi:type stripped using Axis2 and Tomcat?

I’m new to XMLBeans and have been trying to use it to create an XML document as part of an axis2 web service. When I run my code as a standard Java application or as a standard servlet, the XML is correctly generated: <?xml version="1.0" encoding="UTF-8"?> <c:BroadsoftDocument protocol="OCI" xmlns:c="C"> <sessionId>000000001</sessionId...

Compiling multiple XSD into single JAR using XMLBeans

I have the following directory structure: schema1 schema1.xsd schema1.xsdconfig schema2 schema2.xsd schema2.xsdconfig schema3 schema3.xsd schema3.xsdconfig I am trying to compile all of these into a single JAR file using XMLBeans, but cannot work out the scomp command line to compile all of this together. I ne...