Questions tagged [xmlbeans]

XMLBeans is a technology for accessing XML by binding it to Java types.

XMLBeans is a technology for accessing XML by binding it to Java types.

XMLBeans provides several ways to get at the XML, including:

  • Through XML schema that has been compiled to generate Java types that represent schema types. In this way, you can access instances of the schema through JavaBeans-style accessors after the fashion of "getFoo" and "setFoo". The XMLBeans API also allows you to reflect into the XML schema itself through an XML Schema Object model.
  • A cursor model through which you can traverse the full XML infoset.
  • Support for XML DOM.

XMLBeans was retired in 2014, and active development was ceased. However, in 2018 it was unretired and a new major version, 3.0.0, was released in June that year.

For an introduction, see the XMLBeans Overview or Getting Started With XMLBeans.

292 questions
3
votes
2 answers

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?
nobody
  • 1,909
  • 5
  • 31
  • 45
3
votes
1 answer

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,…
MikeJiang
  • 65
  • 4
3
votes
4 answers

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), joefoo@example.com
wsams
  • 2,499
  • 7
  • 40
  • 51
3
votes
1 answer

How to add nodes from another xml using xmlbeans

I am using xmlbeans to generate the xml document, while I need to extract all the children from another xml file and insert them to my current document. The to_be_add.xml:
hguser
  • 35,079
  • 54
  • 159
  • 293
3
votes
2 answers

Builder Pattern with Generics and a static inner Factory on the extended class

I'm trying to implement the builder pattern for generating Apache XmlBeans objects. I've generated builders for all my classes, which inherit from: public abstract class Builder { protected T xmlObject; …
Sirs
  • 1,277
  • 17
  • 30
3
votes
1 answer

Is there a way of handling multiple xsd versions with xmlBeans?

I know that I can compile multiple xsd files in a single jar. I've tried using different namespaces which only takes me half way through my goal. This way I can parse the correct schema but I want this to be transparent to my users which will…
esper
  • 125
  • 1
  • 9
3
votes
2 answers

How to XmlObject.selectPath() by *default* namespace?

I found this method of querying an XmlObject to return an element containing a particular namespace: XmlObject xobj = XmlObject.Factory.parse( "\n" + " \n" + " …
Withheld
  • 4,603
  • 10
  • 45
  • 76
3
votes
2 answers

How to extract information from XmlObject in JAVA without using toString()?

I have an XmlObject (org.apache.xmlbeans.XmlObject) obj . XmlObject obj; ... obj.toString(); //n2 // content ="n2" String content = obj.toString().substring(14, obj.length() - 15) What is the…
M.C.
  • 1,765
  • 3
  • 29
  • 31
2
votes
2 answers

Update partial XML mapping to bean

I need to map an xml file subset of nodes to a Java Bean. For example map Value Value Value Value Value to public class DataBean…
dash1e
  • 7,677
  • 1
  • 30
  • 35
2
votes
2 answers

order of parsed elements is lost in XMLBeans

I have a XML structure somewhat like this: My XSD looks like this:
Stroboskop
  • 4,327
  • 5
  • 35
  • 52
2
votes
2 answers

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 some text DOM Document: At the end…
Juraj
  • 1,951
  • 2
  • 21
  • 30
2
votes
2 answers

xmlbeans.xmlexception. illegal XML character 0x0

I create an xml document in C# by converting a string to bytes via System.Text.UTF8Encoding(). I then send this to my java program for xmlbeans to parse via a TCP connection. No matter what i try, i am getting this…
Jason
  • 2,147
  • 6
  • 32
  • 40
2
votes
1 answer

XMLBeans get_store() method returns null

I am developing a Axis2 based WebServices with XMLBeans binding. I have generated the code by using WSDL2Java generator and tried testing it with sample values set in the request. In one of the setter methods (auto-generated code) I found the below…
R K
  • 1,283
  • 1
  • 14
  • 41
2
votes
3 answers

Encoding XML entities in string using Apache XMLBeans

I'd like to use Apache XMLBeans to escape a String for embedding it in an XML document, e.g. encode all XML entities. XmlString does provide this functionality, but insists on wrapping the output in xml-fragment tags, which I'd like to get rid…
otto.poellath
  • 4,129
  • 6
  • 45
  • 60
1 2
3
19 20