xmlbeans

How to add a node to XML with XMLBeans XmlObject

My goal is to take an XML string and parse it with XMLBeans XmlObject and add a few child nodes. Here's an example document (xmlString), <?xml version="1.0"?> <rootNode> <person> <emailAddress>[email protected]</emailAddress> </person> </rootNode> Here's the way I'd like the XML document to be after adding some nodes, <?xml ver...

How to add custom SOAP header in Spring WS using Axiom and XmlBeans

I'm using Spring WS 1.5.8, XmlBeans for marshalling/unmarshalling and AxiomSoapMessageFactory. My app. needs a custom SOAP header. The data that needs to be in the SOAP Header is a XmlBean (i.e sessionContext in the code below). How can I construct the SOAP Header with this XmlBeans XmlObject element in it? I've mentioned the code of my ...

how to import other schema jars when using the scomp tool

there is a huge amount of xml schemas for the business, some of them are common types like Money.xsd, Address.xsd, etc, while others are business specific like Customer.xsd, ShippingOrder.xsd, etc. So I decide to compile these schemas into 2 jars, one is commonbeans.jar, the other is businessbeans.jar. I've separated them into different...

java xmlbeans and marshalling special characters

Hey guys, I have a schema which I use xmlbeans to umarshal to java objects. I have no control over the kind of data that comes thru. One such field looks like <Name>Barnes & Noble</Name> Parsing fails at the character & with lexical error. Is there a way to specify an option while parsing xml files to ignore some special characters? ...

Adding namespace definition to xml using apache xmlbeans

I need to add namespace defintion to an element since its not getting added when when xml is generated using apache xmlbean. How do I acheieve this using xmlbeans API? ...

How to include automatically xmlbeans generated code into maven jar?

I have a project which uses Apache Xmlbeans for databinding. Currently it is very simple it only has some Schema-Files in src/main/xsd and xsdconfig in src/main/xsdconfig. I want to include the generated Classes into the generated jar-File. It works if I specify the xmlbeans goal: "mvn xmlbeans:xmlbeans package" --> Creates a Jar with t...

Easy way to convert an org.apache.xmlbeansXmlObject to nu.xom.Element

I have used the scomp tool from XMLBeans to generate java classes and then populated the fields in an XmlObject (I wrote this code some time ago). I now need to convert this object into the Element class used by the XOM library. Is there an easier way than by traversing the XmlObject using an XmlCursor and then adding child nodes to the...

Dealing with shared namespaces with multiple WSDL's (xmlbeans)

I have five WSDL's that share namespaces, but not all of them. I generate client code out of them (databinding with XMLBeans). Seperately they compile fine. I create JAR files out of each generated client code. Once I try to use all JAR files within a project, I get naming / compile conflicts. I want to reuse as much as possible. Is t...

how to load selective element using xmlbeans

Hi, I use xmlBeans library for handling xml files. Suppose I have a xml like below: <exDoc> <A name="a1"> <B name="b1"> <c name="c11"/> <c name="c12"/> </B> </A> <A name="a2"> <B name="b2"> <c name="c21"/> <c name="c22"/> </B> </A> </exDoc> I want to get only the entire element A with name a2 instead of loading the entire document in...

xml beans: error "date before year -4713"

Hi All, I have next xml <b:Recording> <b:startTime>2010-08-03T08:39:31.132625</b:startTime> <b:stopTime>2010-08-03T08:40:50.132625</b:stopTime> <b:timeDiff>PT3M10.867375S</b:timeDiff> </b:Recording> during process of serializetion t...

Extending XMLBeans Generated Classes in Java

Does anyone know how to extend an XML beans generated class in Java so that the extended class can be used? I am really struggling! FlightImpl is the implementation of the generated classes. When i use the super constructor argument schemaType() the code compiles fine. The problem arises that when i then try to refer to this object for ...

Tutorial about XMLObject

Appreciate anyone could point me to a nice tutorial of using XMLObject from org.apache.xmlbeans. I have been doing axis2 which gives me a response of XMLObject. However, I can't get to the getTextContent(). After googling for hours, I realise I maybe need to convert the XMLObject back to ArrayList or something like that. ...

XMLBeans and Substitutiongroup

I'm trying to generate an xml document (an SLD file, to be precise) using XMLBeans. Ideally, I want an output like: <PolygonSymbolizer> ... stuff </PolygonSymbolizer> However, what is being outputted is: <Symbolizer type="PolygonSymbolizerType"> ... stuff </Symbolizer> Even when I try to do an XMLObject.substitute, it doesn't ...

Within CXF, why use any other binding than JAXB? (MTOM attachments, Aegis, XMLBeans,...)

I have been playing around with Apache CXF, in particular the various data bindings it supports: JAXB (the default), MTOM, Aegis and XMLBeans. Since all of these are supported, I suppose each has its merits. I came up with these: Obviously, MTOM is to be preferred where large attachments are involved. JAXB depends on annotations, so it...

xmlbeans and namespaces attributes

Hi, I'm trying to use xmlbeans to parse Google geocoder xml responses. I have an xsd which defines a subset of the KML returned by the geocoder. For reference here is an example geocoder response: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.0"&gt; <Response> <name>520 3rd Street San Francisco CA...

xmlbean : dealing with int and a missing element

Hi, When binding a POJO with xmlbean, if a tag, normally with an int, is missing, it is mapped with 0. I know that adbean would map it with Integer.MIN_VALUE. Is there a such possibility ir anything else with xmlbean ? Thanks, David ...

Apache XMLBeans override equals

We currently use Apache XMLbeans to generate xml bindings in Java. In the generated classes, equals method is not overridden which means that comparison is done using Object's equals method( using '=='). Is there a way to customize the class generation such that an implementation of equals() can be provided? ...

How to get rid of generics warnings in code generated from xmlbeans-maven-plugin?

I have some code generated from xsd files by xmlbeans-maven-plugin. Unfortunately generated code uses raw collection types, like: java.util.List targetList = new java.util.ArrayList(); get_store().find_all_element_users(CURRENCY$0, targetList); Currency[] result = new Currency[targetList.size()]; targetList.toArray(result); which caus...

Axis2 Xmlbeans getter methods return null

Hi All, I need to create Client classes for webservices hosted remotely. I used WSDL2JAVA (axis2-1.4.1) to generate java code out of the WSDL provided by my client. This tool gave me the source code and a build.xml. I then ran the ant build provided to get the jar. Command used to generate the code: wsdl2java -p net.XXX.web.wsclien...

How to make XmlBeans play nicely with eclipse (and the maven-eclipse-plugin)

The XmlBeans Eclipse plugin seems moribund, last released a long time ago. Meanwhile, when you run XmlBeans on an XSD, what comes out is not just Java source code, but also binary classes. I can't figure out how to get Eclipse to include those classes in the classpath when running code that uses the resulting API, and the result is clas...