Questions tagged [xjc]

XJC is a JAXB tool for compiling XSD (XML Schema) to Java source code.

XJC is a JAXB tool for compiling XSD (XML Schema) to Java source code.

733 questions
13
votes
2 answers

how to make cxf-xjc-plugin generate sources in utf-8

I try to generate java classes from xsd in a maven project using cxf-xjc-plugin. It runs fine, but the generated source files get platform specific encoding (cp1251 on a windows pc) instead of utf-8. If any xsd types contain non-latin characters in…
MaxVar
  • 133
  • 1
  • 1
  • 7
13
votes
2 answers

generate Go structs from XSD

recently I am planing to do a project using Go. My problem is : given a XSD file, how to auto-generate structs in Go to represent the XML elements. It is similar to using 'xjc' to generate java classes from XSD. So is there any tools or packages to…
user2912044
  • 131
  • 1
  • 1
  • 3
12
votes
1 answer

Prefixing JAXB generated classes

I have this Maven "task" to generate Java classes from an XSD file using JAXB. com.sun.tools.xjc.maven2 maven-jaxb-plugin
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
12
votes
5 answers

JAXB List Tag creating inner class

So we have an XSD type in the form:
Jim
  • 22,354
  • 6
  • 52
  • 80
12
votes
2 answers

specify type for IDREF in XML schema

I am generating Java objects from an XML schema using xjc. I would like to reference the same element multiple times within the document using IDREF. I would also like to constrain the objects referenced by IDREF to a specific type. I'd like to…
undefined
  • 6,208
  • 3
  • 49
  • 59
11
votes
3 answers

Selecting nodes with XPath for binding a subset of classes with JAXB

Simplified Question: What's the XPath to select all XML nodes with an attribute that ends with the string "Notification". The first and third nodes in this snippet:
matt burns
  • 24,742
  • 13
  • 105
  • 107
11
votes
2 answers

Why does jaxb2-maven-plugin xjc fail with Corretto jdk11.0.15_9 but not with Temurin jdk-11.0.14.1+1

Since upgrading my jdk to Corretto jdk11.0.15_9 the xjc goal of jaxb2-maven-plugin fails. The problem doesn't manifest when running with Temurin jdk-11.0.14.1+1. I'm running it on windows 10 with maven 3.8.5. Command: > set…
Kristof Neirynck
  • 3,934
  • 1
  • 33
  • 47
11
votes
1 answer

jaxb2-maven-plugin Jakarta and java 11

I am trying to migrate to java 11 and jakarta. I need to create java classes from XSD Files as I did in Java EE. I have changed all jaxb imports into jakarta. But I can not make jaxb2 to create classes with jakarta namspace instead of jaxb. If I add…
Iman
  • 769
  • 1
  • 13
  • 51
11
votes
2 answers

Generate additional custom method with jaxb-xjc

There's some way to generate a custom method within an class generated with JAXB. I search around tutorials, including oracle's tutorial, but I didn't find clear instructions how can I custom methods to a generated class described on XML Schema.
Andre Pastore
  • 2,841
  • 4
  • 33
  • 44
11
votes
2 answers

Generating unique serializable id for each of the generated classes in JAXB

I am using ant wsimport to generate client stub from the wsdls. Also, I would like to generate client classes that implements Serializable. I would like to generate a different serialVersionUID for each class. I tried with the binding file that was…
javageek
  • 111
  • 1
  • 3
11
votes
1 answer

Remove intermediate class when generating code from schema

Let's assume we defined a collection type in XSD as
mibollma
  • 14,959
  • 6
  • 52
  • 69
11
votes
1 answer

JAXB xjc mapping to existing domain objects

I have done a lot of searching and cannot find a concise example of how to map an XML schema to existing domain objects instead of creating brand new ones utilizing xjc. I have created a bindings (xjb) file but still can find no way of…
colbyjax
  • 133
  • 1
  • 8
11
votes
3 answers

Maven JAXB2 XJC plugin: M2E plugin execution not covered

I am using using the jaxb2 xjc plugin for generating java files from a XSD. Therefore I used to configure my pom.xml as follows: org.codehaus.mojo
Jean Logeart
  • 52,687
  • 11
  • 83
  • 118
10
votes
2 answers

Compile several XSD's containing duplicate definitions of the same element with JAXB

Question: How do i make xjc/Jaxb generate the propper javaclasses for several schemas containing duplicate elementdefinitions in the same namespace? Information: I have three .xsd schemas: A,B and C. All have the same targetnamespace. They are all…
Sofus Albertsen
  • 163
  • 1
  • 1
  • 11
10
votes
2 answers

JAXB External Custom Binding XJC Issue - Parsing results in empty node

Forgive me if this is a duplicate. Here is my binding.xjb file. But now i am getting the regular error that the complex type target "AddBankVaultRplyType" is not found. I don't see any issue. Can somebody help me with this? I am listing the xsd that…
juniorbansal
  • 1,249
  • 8
  • 31
  • 51
1 2
3
48 49