xml « jaxb « Java XML Q&A

Home
Java XML Q&A
1.convert
2.Development
3.document
4.dom
5.dom4j
6.dtd
7.element
8.jaxb
9.jaxp
10.jdom
11.jsoup
12.namespace
13.Node
14.parse
15.parser
16.pdf
17.sax
18.schema
19.stax
20.tag
21.transform
22.Validation
23.xalan
24.xmlbeans
25.xpath
26.xsd
27.xslt
28.xstream
Java XML Q&A » jaxb » xml 

1. Updating from Jaxb 1 to Jaxb 2    stackoverflow.com

I'm looking to update our project's jaxb version from 1 to 2. Has anyone tried doing this on their projects and are there any tips that anyone wanting to do ...

2. JAXB XML output format questions    stackoverflow.com

I have Java classes with the following structure (the class names do not imply anything, I was just making them up).

package test;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import ...

3. JAXB Types problem    stackoverflow.com

I have an xsd that looks like this (snippet):

<xs:complexType name="IDType">
  <xs:choice minOccurs="1" maxOccurs="2">
    <xs:element name="FileID"    minOccurs="0" maxOccurs="1" type="an..35" />
    <xs:element name="IDNumber1" ...

4. Relaxer or JAXB for XML->Object Model?    stackoverflow.com

I would like generate an AST from my XML-definition, to be used for code generation later on. The XML schema is written in Relax NG, since it seemed like a neater ...

5. JAXB Java to XML: How not printing primitive type members when default    stackoverflow.com

First attempt to use this cool site - after searching for 2 hours: So I have a Java Bean that is given (I can only annotate not change) and need to map ...

6. how to create customized marshalled output from JAXB?    stackoverflow.com

I don't want to use XML file created by JAXB marshaller, can I customize it, so that i would give a preferrable format to marshal objects?

7. JAXB is good until I need to do something complex. What are the alternatives?    stackoverflow.com

JAXB works well until I need to do something like serialize beans for which I cannot modify the source. If the bean doesn't have a default constructor or if it refers ...

8. JAXB vs Apache XMLBeans    stackoverflow.com

Anyone can tell me which one is better (JAXB or Apache XMLBeans) taking in account the performance for files bigger then 10Mb?

9. Are there any memory utlization issue with JAXB?    stackoverflow.com

I am using JAXB for xml parsing, are there any performance or memory utilization issues?

10. Don't show Object Tag, only it's attribues with JAXB    stackoverflow.com

If I have 3 objects A, B and C. Where A has B which has C, I don't want to show

<a>
  <b>
    <c/>
  </b>
</a>
I want ...

11. tell jaxb to not remove underscores    stackoverflow.com


Is there a way to tell JAXB to not remove underscores when creating getter/setter names from XML Schema?
Reason: this causes loss of information and it is harder to trip between XML ...

12. Is there a way to configure rendering depth in JAXB?    stackoverflow.com

Let's say I've got my domain objects laid out so the XML looks like this:

<account id="1">
  <name>Dan</name>
  <friends>
    <friend id="2">
      <name>RJ</name>
 ...

13. I can't distribute JAXB closed code?    stackoverflow.com

At https://jaxb.dev.java.net/ it says JAXB its under dual license consisting of the CDDL v1.0 and GPL v2; And CDDL says:

  1. Distribution Obligations 3.1. Availability of Source Code. Any Covered Software that You ...

14. What is the opposite of JAXB? i.e. generating XML FROM classes?    stackoverflow.com

I am currently designing a solution to a problem I have. I need to dynamically generate an XML file on the fly using Java objects, in the same way JAXB generates ...

15. how to remove empty tags in input xml    stackoverflow.com

My java module gets a huge input xml from a mainframe. Unfortunately, the mainframe is unable to skip optional elements, with the result that I get a LOT of empty ...

16. How to generate CDATA block using JAXB?    stackoverflow.com

I am using JAXB to serialize my data to XML. The class code is simple as given below. I want to produce XML that contains CDATA blocks for the value of ...

17. Dynamic tag names with JAXB    stackoverflow.com

I am using Jersey and JAXB to build a simple RESTful webservice I have a HashMap of 'String' to 'Integer':

2010-04 -> 24 
2010-05 -> 45
I need to generate an XML response which ...

18. Where I can find a detailed comparison of Java XML frameworks?    stackoverflow.com

I'm trying to choose an XML-processing framework for my Java projects, and I'm lost in names.. XOM, JDOM, etc. Where I can find a detailed comparison of all popular Java XML ...

19. JAXB: How to customize Xml serialization of double fields    stackoverflow.com

I have a legacy class, with a lot of public double fields. All double fields are initialized with Double.MAX_VALUE to indicate that they are empty. (The legacy serialization is coded to ...

20. How to generate two different structure xml from one class using JAXB    stackoverflow.com

I have two class, Node and Group, the Group is Node's sub-class.

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Node", propOrder = {
    "id",
    "children"
})
public class Node {

    ...

21. How do you customize how JAXB generates plural method names?    stackoverflow.com

We are using JAXB to generate Java classes and have encountered a few cases where generated plural method names are not correct. For example, where we expect getPhysicians we are getting ...

22. In ActionScript 3, how to decode from xml to ActionScript class?    stackoverflow.com

In ActionScript 3, how to decode from xml to ActionScript class ? I could encode from ActionScript class to xml by using XmlEncoder. The xml schema I used at that time is this. [schema1.xsd]

<?xml ...

23. JAXB Performance    stackoverflow.com

In my current project I have a requirement where I need to build an xml document. I am planning to go with JAXB by creating the Java domain classes and marshall ...

24. How to generate JAXB classes from just XML    stackoverflow.com

I need to generate classes from xml that doesn't provide a schema. I understand this is near useless, but the fact is we have xml, it's structured, and we should be ...

25. Object to XML, backward and forward compatibility    stackoverflow.com

I am working in an application where we need to save objects in XML format, and load them later once required. For this I have used JAXB to marshall and unmarshall ...

26. Mapping JAXB data to a Domain Model    stackoverflow.com

I get an InputStream from a web services call, and I use JAXB to convert it to objects, so I do not have to parse the xml. The objects contain a bunch ...

27. create nested structure using JAXB notations    stackoverflow.com

<?xml version='1.0'?>
<info>
     <contract>
       <symbol>IBM</symbol>
       <sectype>STK</sectype>
       <exchange>SMART</exchange>
    ...

28. XML library with a low footprint    stackoverflow.com

Because of increasing configuration complexity, I want to introduce XML for my library's configuration files, and replace the existing properties files. I would like to

  • Publicly describe the XML structure with XSD (so ...

29. JAXB: how to get value in wrapped type?    stackoverflow.com

@XmlRootElement(name = "toplist")
class toplist {

    private String description;

    private List<Item> items= new ArrayList<Item>();

    @XmlElement(name = "description")
    public String getDescription() ...

30. How do I specify the adapter(s) which JAXB uses for marshaling/unmarshaling data?    stackoverflow.com

Is there a way to specify the Adapter which JAXB uses for marshaling/unmarshaling objects in my XML schema? For example, if I want to parse the following as an integer:

<SpecialValue>0x1234</SpecialValue>
I can use ...

31. Does JAXB support modification of existing XML documents without marshalling/unmarshalling?    stackoverflow.com

I want to keep comments, ordering, etc. in the document and edit the document in-place using a Java interface. Does JAXB do this? Do other tools such as XMLBeans do this?

32. what is the benefit in dynamically generating java bean classes from xml?    stackoverflow.com

I had written a lot of java bean classes using my IDE. Another person suggests a different approach. He suggests that I put an xml file with bean definitions in them. ...

33. Customized JAXB xml output    stackoverflow.com

Given the following class:

public class Customer {
  public String name;
  public String lastName;
}
I want to generate the following xml output using JAXB for a customer whose name is John ...

34. Changing method name adds unwanted XML Block    stackoverflow.com

For the life of me I cannot figure out why this is happening to my code. I wrote a java program to add a block of XML to an existing XML file. ...

35. Jaxb DateTime without timezone    stackoverflow.com

I'm trying to map a xml DateTime element using jaxb so that it does not care about timezone information at all. Either by rejecting the input, or by treating it as ...

36. Dealing with poorly designed XML with JAXB    stackoverflow.com

I'm currently working on replacing a legacy system with JAXB and I'm running into problem with parsing the XML. The number one requirement of the system is that it must be ...

37. JAXB Dynamic Xml Tag Generation    stackoverflow.com

In my current JAXB marshaller application, I need to conditionally write an element into xml. Let me see if I can think of an example without making it sound like a ...

38. How can I send a REST XML POST request via curl?    stackoverflow.com

Basically, I have a project set up in Restlet which uses JAXRS for mapping resources to paths and uses JAXB for serializing and deserializing XML to/from Java types. I'm currently trying ...

39. Which XML parser to use here?    stackoverflow.com

I am receving an XML file as an input, whose size can vary from a few KBs to a lot more. I am getting this file over a network. I need ...

40. how to get anyType value using jaxb?    stackoverflow.com

I have an xml that looks like this:

<Root>
   <tag1>4</tag1>
   <tag2>aa</tag2>
   <tag3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <anyType xsi:type="xsd:string">bla bla bla</anyType>
    ...

41. Changing Date format output by javax.xml    stackoverflow.com

I have a Tomcat server app, which creates xml responses based on classes I populate. One of the classes has a date field:

@XmlRootElement
public class Login {

    private String mLoginUserID;
 ...

42. Process XML data with Java    stackoverflow.com

I am software written in Java which read an external XML file (let's call it "datasource.xml"). This file contains different information and this information are extracted using XPath queries. The fact is that, ...

43. How to configure JAXB so it trims whitespaces by default    stackoverflow.com

I would like to configure JAXB so that it trims whitespaces on all string fields I saw the following answer : How to configure JAXB so it trims whitespaces when unmarshalling ...

44. JAXB with variable number of @XMLElements    stackoverflow.com

Following the tutorial given in http://blog.adamsbros.org/2010/02/07/jaxb-example-code/ I'd like to know if it is possible to have variable number of XMLElements. For example, my class will be:

@XmlRootElement(name = "employee")
public class Teacher ...

45. JAXB and class instantiation    stackoverflow.com

One thing that prevents from using a binding technology like JAXB, instead of a classic dom/sax-based xml technology is the fact that, when reading xml, it seems to be strongly oriented ...

46. jaxb - how to create XML from polymorphic classes    stackoverflow.com

I've just started using JAXB to make XML output from java objects. A polymorphism exists in my java classes, which seems to not working in JAXB. Below is the way how ...

47. creat simple xml     stackoverflow.com

I am trying to build server that sends a xml file to client. I am getting info from db and wants to build from that xml file. But I have a problem ...

48. How to use JAXB to generate a xml from a bean    stackoverflow.com

I wamt to generate xml from java class using JAXB from a bean class,please let me know which are different approaches for the same. I have tried one from ...

49. Duplicated field in generated XML using JAXB    stackoverflow.com

This is my scenario. I have a generic class:

public class Tuple<T> extends ArrayList<T> {
  //...
  public Tuple(T ...members) {
    this(Arrays.asList(members));
  }

  @XmlElementWrapper(name = "tuple")
 ...

50. JAXB - While generating the xml can we check the value of the object before generating    stackoverflow.com

Suppose i have an object

@XmlRootElement(name = "publisher")
class Person
{
 @XmlElement(required = true)
 int id;
 @XmlElement(required = true)
 String name;
}
I want to generate like
<person>
<id>1</id>
<name>test</name>
</person>
Suppose if the name is test10 I dont want ...

51. Set schemaLocation on XML JAXB    stackoverflow.com

I need to add schemaLocation Property that is nested on another object, I have a class...

...
@XmlRootElement(name = "Comp")
public class Comp {
...
I marshall objects of this class setting Marshaller.JAXB_SCHEMA_LOCATION and it works ...

52. JAXB processing of XML sequences    stackoverflow.com

I'm trying to process some XML files using the JAXB implementation shipped in Java 7. I'm using these versions :

501 ~ % xjc -version
xjc 2.2.4
502 ~ %java -version    ...

53. how to include xchema namespave in the instantiated xml in jaxb    bytes.com

Hey guys, I am using an xsd to generate an xml file. For this I'm using jaxb from "https://jaxb.dev.java.net/2.1.9/JAXB2_20081030.jar". I have successfully managed to create marshal for a context and generated ...

54. Generate XML with out JAXB    coderanch.com

A writeXLM method would return a chunk of XML for that one object, and perhaps contained objects. For example, if my Person class had only one field for name, it might just say: return "" + getName() + ""; That approach bakes the ability to build XML right into every class. That doesn't go well with the Single Responsibility Principle, or ...

56. Jaxb Implementation - Jdk 1.3 - Reading an XML andconvert into Java Object    forums.oracle.com

Hi All, I am trying read an XML document using Jaxb in my java program. the problem is that ,Since I am using jdk1.3 in my Ibm -wsad IDE v5.1 , I am unable to do it. Its easy to implement this in Jdk 1.4 and higher level. Please suggest which jars need to be included to run my program. I ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.