xsd « 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 » xsd 

1. JAXB Binding Customization    stackoverflow.com

While trying to generate classes from a xsd, i got this error:

java.lang.IllegalArgumentException: Illegal class inheritance loop.  Outer class OrderPropertyList may not subclass from inner class: OrderPropertyList
My xsd define a element ...

2. JAXB - XJC - influencing generated typesafe enum class and members    stackoverflow.com

When compiling the following simpleType with the XJC compile (from the JAXB package)...

<xs:simpleType name="test">
    <xs:annotation>
        <xs:appinfo>
      ...

3. JAXB - Remove 'standalone="yes"' from generated XML    stackoverflow.com

Do you know of a JAXB setting to prevent standalone="yes" from being generated in the resulting XML?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

4. JAXB Documentation Annotation    stackoverflow.com

I have the following java class with the JAXB @XMLRootElement annotation

@XmlRootElement(name="ClientData")
public class ClientData {

/**
 * The first address field of the person
 */
private String address1 = null;
}
which produces this xml fragment ...

5. Creating a custom JAXB annotation    stackoverflow.com

Do people have any recommendations on how i could write my own custom JAXB annotation handling class to support the generation of xs:annotation/xs:documentation elements in the xsd schema?. I'd like to ...

6. JAXB: Anonymous simple types as enums?    stackoverflow.com

When generating Java from an XSD via the XJC compiler, I always get the type java.langString for elements with anonymous simpleTypes like this:

    <xsd:element name="Product">
 <xsd:simpleType>
  <xsd:restriction ...

7. XSD: ComplexType    stackoverflow.com

I have a complexType like:

<xsd:complexType name="NightlyRate">
    <xsd:complexContent>
        <xsd:extension base="com:Money">
            <xsd:attribute ...

8. Xsd:list--> date issue    stackoverflow.com

I am using JAXB to parse my xml schema(xsd). I have a complexType as follows:

<xsd:complexType name="PromotionalInfo">
    <xsd:attribute name="promotionName" type="xsd:string" use="required"/>
    <xsd:attribute name="blackOutDates" type="DateList"/>
   ...

9. XML-schema: Equivalent to nullable="true" for attributes?    stackoverflow.com

I have been having problem with adding type="date" in my schema, as whenever it is null it throws a marshalling error. I found out that for elements we can add an ...

10. XSD attributes and abstract    stackoverflow.com

I have a hierarchy of Line<--SPLine, Line<--DID_Line Line<--TollFree etc. Then for each line there is a type of action. So I have it looking like this in the xsd:

<xsd:complexType name="line" ...

11. How to generate @XmlRootElement Classes for Base Types in XSD?    stackoverflow.com

I am having some issues with generating Java Classes with appropriate JAXB annotations from an XSD using XJC. I have a relatively simple XSD file defining my XML schema. The complex types ...

12. How can I process multiple xsd shemas using jaxb and the Ant xjc task?    stackoverflow.com

I'm using jaxb to generate java object class from xml schemas within an Ant script like so:

<!-- JAXB compiler task definition -->
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"
        ...

13. JAXB generate java class from xsd    stackoverflow.com

  1. JAXB 1.5 installed under C:\Sun\jwsdp-1.5
  2. J2SE 1.4.2 installed under C:\j2sdk1.4.2_08
  3. copied sample.xsd file to C:\Sun\jwsdp-1.5\jaxb\bin
  4. went to C:\Sun\jwsdp-1.5\jaxb\bin and ran xjc.bat -p com.package sample.xsd
  5. got error message: Unrecognized option: -p ...

14. JAXB XJC code generation - "schemaLocation" missing in xml generated by Marshaller    stackoverflow.com

I Use XJC tool to generate Java classes for my XSD schema. When I use JAXB Marshaller to marshall classes into XML payloads, I'm missing "schemaLocation" parameter in the output XML, ...

15. JAXB IDREF and ID usage?    stackoverflow.com

I'm looking to write an XSD which will be used to generate some Java classes via JAXB. I'd like the resulting XML to look like this:

<Appointment>
    <Patient ...

16. Generating Java classes out of XMLSchema.xsd using JAXB    stackoverflow.com

I'm using jaxb to generate java classes out of a xml schema. The schema imports XMLSchema.xsd and its content is used as an element in the document. If I remove the import and ...

17. JAXB - Beans to XSD or XSD to beans?    stackoverflow.com

I have an existing data model. I would like to express this data model in terms of XML. It looks like I have two options if I'm to use JAXB:

  • Create an ...

18. How to generate several versions of Java classes generated by JAXB?    stackoverflow.com

I recently generate two versions of Java classes generated by JAXB. So I get two packages : V1_0 and V2_0 I notice that I have only one ObjectFactory generated. The problem is that ...

19. Missing JAXB classes from XMLschema.xsd    stackoverflow.com

I'm working on a xml schema resolver and I'm using JAXB with XMLSchema.xsd. I experience problems with JAXB, because I don't get classes for all the top level elements. For example for

<xs:element ...

20. Resolve naming conflict in included XSDs for JAXB compilation    stackoverflow.com

I am currently trying to compile with JAXB (IBM build 2.1.3) a pair of schema files into the same package. Each will compile on it's own, but when trying to ...

21. XML/RDF to Java Objects with XSD    stackoverflow.com

So here's the scenario...I have an XSD file describing all the objects that I need. I can create the objects in Java using JAXB no problem. I have an XML/RDF ...

22. Does XSD allow simpleContent and complexContent at the same time?    stackoverflow.com

I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like:

<value><int>123</int></value>
<value><boolean>1</boolean></value>
But at the same time it requires:
...

23. JAXB Locator - missing dependency?    stackoverflow.com

On my current project we generate JAXB beans from an XSD file. We need line number information on the beans (beyond XSD validation errors!) so I used the -Xlocator option specified here:

24. how could I generate xsd dynamically    stackoverflow.com

I want to generate a xsd file dynamically, I don't want to use jaxb because it creates alot of files when I use schemagen and I want the schema in one ...

25. Generating Java Objects with Ant (&xjc) - java packages    stackoverflow.com

I am generating multiple XSD schemas into java objects, and i need to specify the root package. but the package attribute is not recognized by Ant... (don't know why...) what should i ...

26. JAXB code generation: restricted type -> how to remove a zero occurrence field?    stackoverflow.com

I use JAXB 2.1 to generate Java classes from several XSD files that I cannot modify (coming from a WSDL file actually), and I have a problem related to complex type ...

27. HyperJaxb3 and xsd:anyType    stackoverflow.com

I have a schema fragment that looks like

<xs:element name="dataValue">
        <xs:complexType>
            <xs:sequence>   ...

28. jaxb2-maven-plugin always prints warning when generating beans from XSD    stackoverflow.com

I'm trying to generate beans from an xsd by using the jaxb2-maven-plugin maven plugin, however each time the beans are generated i get the following warning. Note that the result beans ...

29. XSD anytype and JAXB    stackoverflow.com

I have an xsd definition (from www.tmforum.org ossj common api v1.5)

<element name="primaryKey" nillable="false">
   <complexType mixed="false">               ...

30. JAXB to be create a map from XSD    stackoverflow.com

When JAXB generates this, it create the OtherProperties as a List. How can I configure the XSD so it is generated as a Map?

        ...

31. JAXB, xs:any and targetNamespace    stackoverflow.com

I have an XSD that defines the following schema:

<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
       xmlns="http://example.com/2010/aa/"
       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
       ...

32. How to generate java code from xsd using jaxb and not allowing the user to use the xml attribute    stackoverflow.com

I'm using JAXB to generate java code from xsd. I want to generate attribute (Java code) that cannot be used in the xml. For example:

<xs:complexType name="Button">
   <xs:attribute type="xs:string"
   ...

33. controlling the class names generated by JAXB for xsd:attributeGroup?    stackoverflow.com

I am using JAXB to bind XML to Java for an application that I am writing. I have an element called measure which contains two amount elements called amount and maxAmount, ...

34. Dynamic java bean from xsd    stackoverflow.com

I have two applications, one acting as client and the other as server. In server application I generate ObjectFactory and classes using xjc from Eclipse. As a result, one of this ...

35. JAXB workaround for Chameleon XSD imports?    stackoverflow.com

this is my first question, so please be gentle ;) I'm stuck with a weird problem. Essentially i get three XSD definitions like the following:

PartA.xsd
targetNameSpace="PartA"
include="PartB.xsd"

PartB.xsd
<!-- no namespace definition!!! -->

PartC.xsd
targetNameSpace="PartC"
inlude="PartB.xsd"
import="PartA.xsd"
The error pops up, ...

36. How do I make more complex XSDs using JAXB?    stackoverflow.com

Using JAXB I can create an XSD using code like:

JAXBContext ctx = JAXBContext.newInstance(classes);
ctx.generateSchema(new MySchemaOutputResolver());
That makes a goods XSD describing the structure of all the JAXB objects in the list of classes ...

37. How do I reuse annotations across complexTypes?    stackoverflow.com

I'm trying to write my first xsd which will have JAXB mapped POJOs generated from it, to be used in a webservice. There will be three related classes which I would ...

38. XML + XSD => Java?    stackoverflow.com

I need to make the above equation comes true! I have an XML file with its XSD schema, and I need to get the Java classes with the required code to parse ...

39. JAXB (un)marshalling of xsd types: xsd:base64Binary and xsd:hexBinary    stackoverflow.com

JAXB maps both xsd:base64Binary and xsd:hexBinary types to byte[].
Given that I have a schema/a DOM Element representing each of these types such as: <foo>ABCD</foo> for xsd:hexBinary and
<foo>YTM0NZomIzI2OTsmIzM0NTueYQ==</foo> for xsd:base64Binary ...

40. JAXB xsd:include and separate packages    stackoverflow.com

I have the following situation: There are 2 xsd files. The 1st one defines a root element, and several types. The second one includes the first, and extends one of the types. There is ...

41. JAXB - Property "Value" is already defined. Use to resolve this conflict    stackoverflow.com

Using JAXB to generate XML binding classes. The schema is based on a set of legacy XML files, and includes this snippet:

<xs:complexType name="MetaType">
    <xs:simpleContent>
      ...

42. should complex types or anonymous types be used in jaxb/xsd mapping    stackoverflow.com

Long story short : when mapping XML, is it better to have complex types and thus multiple top-level classes or just anonymous types and thus hierarchies of inner classes? Long ...

43. JAXB 2 annotation and XSD    stackoverflow.com

In the JAXB 1.0 era, the recommended way of working with java object, XSD and XML is to start with XSD definition, use JAXB to generate java classes from the XSD ...

44. How do I import xsd files containing JAXB properties?    stackoverflow.com

I am trying to import one XML Schema into another xsd file. However, xjc seems to fail during import when it finds inline JAXB property customizations. The error is, "com.sun.istack.SAXParseException2: compiler ...

45. How to use JAXB APIs to generate classes from xsd?    stackoverflow.com

I need to generate bean classes from .xsd without using xjc command or ant. i have found the implementation in Apache Axis2 but i am unable to generate the artifacts. i ...

46. Strong scientific typing in XML and in Java    stackoverflow.com

My project contains a big XSD Schema, and schema instances are binded to the java code using JAXB. I would like to add strong types into the java code, using JScience, and bind ...

47. JAXB multiple xsd    stackoverflow.com

I have two XSD that I generated through JAXB's xjc command. http://www.imsglobal.org/xsd/imscp_v1p1.xsd and http://www.mmtech.ru/adlcp_v1p3.xsd I am trying to use the Item object from the first xsd like
ItemType item = factory.createItemType();
DataType dataType ...

48. JAXB: How to change XJC-generated classes names when attr type is specified in XSD?    stackoverflow.com

I'm a beginner to JAXB and I'm having annoying issues when generating Java classes with xjc. I am provided with a XSD like this:

<xs:element name="item" type="itemType"/>  
...   ...

49. Java Enum with XML Beans?    stackoverflow.com

When using Apache XML Beans to generate types from xsd:enumeration types, XMLBeans generates custom classes that are not Java 5 enums but some kind of special class to represent ...

50. Building JAXB Contexts with Huge XSDs Runs Out of Memory- Workaround?    stackoverflow.com

Edit: This guy has the same problem, and does a better job of explaining it I feel: http://www.java.net/forum/topic/glassfish/metro-and-jaxb/building-jaxb-contexts-huge-xsds-runs-ou My colleagues have informed me that we have so many JAXB types, that ...

51. Obtain Java Class name from QName    stackoverflow.com

Suppose you have a QName that represents a type in an .xsd document. How can I find out the name of the class that it would unmarshal into? For example, I've ...

52. XJC Generating same classes    stackoverflow.com

I'm using JAXB on two different XSDs. Some of the generated classes appear to be the same. Is this unusual, and when I copy the classes over to my source package ...

53. How to cache xsds to offload w3c servers?    stackoverflow.com

I'm building a web service based on SAML-P and XACML, which requires a large number of XSDs to be considered by JAX-B/XJC for each build. This takes forever and is exceedingly unreliable, ...

54. Jaxb: xs:attribute null values replaced by default values put in xsd    stackoverflow.com

I'm basically trying to set up a role in JAXB which says that whenever an null field is encountered, instead of ignoring it in the output, set it to a default ...

55. JAXB2 map xsd:restrictions as subclasses and (un)marshall xsi:types    stackoverflow.com

I have been doing a lot of research trying to figure this out, but am still unsuccessful. I have a number of XSD that follow this schema: Simple_Identification.xsd

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      ...

56. How to generate Java from an XSD using MOXy under Maven-3?    stackoverflow.com

What's the easiest/best way to generate Java from an XSD using MOXy under Maven-3? The reference JAXB interface has a nice Maven plugin, but it doesn't appear to support MOXy. Does anyone ...

57. java classes creating from xsd via xjc problem    stackoverflow.com

i have the xsd file created and worced fine in VS. But now we need to create java classes corresponding to this. I tryed to use standard xjc tool from the ...

58. JAXB marshaller using Java member variable convention    stackoverflow.com

I'm currently trying to figure out why JAXB marshaller uses Java member variable convention as opposed to follow the XmlType annotation. Here's the situation:

  • Third-party gave us XSD
  • We use JDK tools to generate ...

59. JAXB: Generating classes for two XSDs which share a common XSD    stackoverflow.com

I have 2 service XSD files AService.xsd and BService.xsd each with different targetNamespace. Both of these use a common XSD called common.xsd. I use the JAXB Maven plugin to generate classes. ...

60. JAXB fails unmarshalling some substitutionGroups    stackoverflow.com

I'm having issues unmarshalling XML that has been validated against a schema. I have a large schema provided to me that I have extended. Here's a snippet of what's provided: (Namespace "original")

<xs:element ...

61. generation of java classes from xsd using jaxb    stackoverflow.com

Currently working on a project in which the xsd's have been provided for data exchange. The xsd's are available isotc211. As can be seen there are a couple of ...

62. Using ANT with multiple XSD and single XJB    stackoverflow.com

I have a custom external XJB file that has the schema name within it as follows : jxb:bindings schemaLocation="completeCheck.xsd" node="/xs:schema" Just wondering, is there a way to substitute the schema name ...

63. JAXB: How to know which Java class to unmarshal to when there are multiple XSDs?    stackoverflow.com

I have several XSD files which I have processed using XJC to generate Java classes. I would like to read an arbitrary XML file, and based on the contents of the XML ...

64. JAXB: two versions of XSD, one object model    stackoverflow.com

I have two versions of an XSD Schema. The XSDs are very similar, although the XML namespace is different (the xml namespace is used for versioning). I would like to unmarshall ...

65. generate class from xsd with xjc    stackoverflow.com

i try to generate class from xsd but i got problem with the second line

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:saqcc="urn:saq:cct:cct-3.5.xsd" xmlns:flx="urn:saq:mtl:grey:flux:04489:rep-1.0.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:saq:mtl:grey:flux:04489:rep-1.0.xsd"  elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
... i ...

66. How to inform xjc not to go through xs:import?    stackoverflow.com

I want to create a java classes from the xsd using xjc ant task. Most of it works ok. I need it not to go through and because ...

67. How automatic detect extended class in JAXB?    stackoverflow.com

I have xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <xs:element name="pay" type="simplePay"/>

    <xs:complexType name="simplePay" abstract="true" >
        <xs:sequence maxOccurs="1" minOccurs="1">
  ...

68. JAXB: Prevent classes from being regenerated    stackoverflow.com

I'm having troubles keeping classes from being regenerated. I'm I have a schema A, which is imported in schema B. Schema B is then imported in Schema C. In schema A, I ...

69. JAXB Moxy- Question on how to annotate field that is xsd complex type    stackoverflow.com

I am getting started with JaxB and am using the Moxy implementation. I have an industry standard xsd that I converted to Java Object Model using Jaxb. I have gotten ...

70. JAXB enumeration with numeric values    stackoverflow.com

I want to restrict input values like this

<simpleType name="SomeCode">
  <restriction base="string">
    <enumeration value="036222B"/>
    <enumeration value="036111C"/>
  </restriction>
</simpleType>
But this does not generate an Enum. I ...

71. Problem with unmarshaling xsd:base64Binary    stackoverflow.com

JAXB generated from XSD base64Binary and hexBinary to byte array. I have xsd element with base64Binary. This is strict and cannot be changed. But in this element we has value of ...

72. how use xmlAdapter in maven-jaxb-plugin    stackoverflow.com

Hi I have xsd schema with base64Binary. when this plugin genereted this elemen looks like

@XmlElement(name = "element")
    protected byte[] element;
but how can I tell to this plugin to ...

73. Is it possible to generate a XSD from a JAXB-annotated class?    stackoverflow.com

I've written a number of classes using JAXB for serialization and I was wondering if there was a way to generate a XSD file for each of these objects based on ...

74. What xmlAdapter use JAXB to unmarshlad base64Binary    stackoverflow.com

when I use hexBinary in xsd schema JAXB use HexBinaryAdapter to convert it into byte. But how JAXB convert when I use base64Binary in XSD schema ? there is no XmlAdapter. He ...

75. How to tell jaxb to truncate a BigDecimal when marshalling to xml?    stackoverflow.com

I have these two classes:

@XmlAccessorType(XmlAccessType.FIELD)
public class OpportunityLocation
{

    @XmlElement
    private LatitudeLongitude coordinates;
    [...]
}

public class LatitudeLongitude implements Serializable
{
    private BigDecimal latitude;
 ...

76. JAXB default attribute value    stackoverflow.com

I'm using JAXB annotations to generate xsd schema from my classes. Annotation @XmlElement with parameter defaultValue sets default value for element. Is it possible to set default value for @XmlAttribute? P.S. I checked that ...

77. XSD lowercase enumeration, translated to jaxb object and then to json string, became UPPERCASE    stackoverflow.com

I have an XSD file with enumeration in lower case e.g.

<xsd:simpleType>
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="oneTwo"/>
   ...

78. need nullable double value    stackoverflow.com

i use a xsd schema with an element datatype double like this:

<xsd:element name="value" type="xsd:double"/>
I use the jaxB unmarschaller to create an java class with the appropriate object and attributes. The result ...

79. JAXB: generate Java classes only for a subset of the XSD types    stackoverflow.com

I have a couple of huge XML schema definition (XSD) files and I want to generate only for a subset of the defined types the corresponding Java classes. More precisely I have ...

80. How to tell only certain Classes in XSD to inheirt from a provided interface?    stackoverflow.com

I have found some other questions that ask this in a different way, but none of the answers to those questions work. Either the sites they refer to are dead or ...

81. Create a common xsd generated class to be used by other packages    stackoverflow.com

I am trying to use the same generated class but in separate packages. So the structure should look something like this:

com.test.common
     -commonType.java
com.test.A
     ...

82. How to define a class within a class for 1 to 1 relationship in xsd    stackoverflow.com

If I define my xsd schema like below , the xs:element is giving an error. I want to have a 1:1 relationship between BitStatType and ValidationCountMessage? How can I define ...

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.