Hi,
I am having a problem while doing some XSLT pre-processing in my java program.
We get an asterisk (*) from a mainframe program when it wants to blank out a value, which my java process has to treat like a blank or empty tag. So we apply an xslt to the input before my jaxb process.
We are applying this xslt :
<xsl:stylesheet vers...
JAXB has been great, a real timesaver, but it's still really time consuming to traverse the resulting object trees; almost as bad as working directly with the DOM.
Is there a way that I can do XPath 1.0 queries on a JAXBElement, without having to painstakingly marshal the document to and from a DOM model each time?
...
Hi,
I am writing a plugin for Jira which involves parsing of XML documents. I am using JAXB to do so (XML to pojos and vice versa)
So have a class which generates XML from pojos using JAXB. it looks like...
import javax.xml.bind.*;
Class Parser {
public void m1() {
...
// code which uses classes in javax.xml.bind.*
}
pu...
I'm trying to unmarshal a simple xml document from a public api from Convio. I'm not getting any compiler errors with the following code, but it won't produce a result either. The values are null. If I remove the schema and namespace items from the xml document and remove the namespace attribute from the POJO then it will run just fine. ...
Hi,
I have a schema fragment that looks like
<xs:element name="dataValue">
<xs:complexType>
<xs:sequence>
<xs:element name="value" type="xs:anyType"\>
</xs:sequence>
</xs:complexType>
</xs:element>
The class produced by hyperjaxb3 contains the following fragment:
@Xm...
I have an XmlJavaTypeAdapter defined for each Exception in my exception heirarchy. I use a wrapper object for marshaling the exceptions as below:-
@XmlRootElement
public Wrapper<T extends BaseException> {
T exception;
}
The exceptions:-
@XmlJavaTypeAdapter(BaseExceptionAdapter.class) {
public class BaseException extends RuntimeEx...
Hi,
I'm using Apache cxf to create objects from a WSDL. Everything works fine but I have some XHTML inside the SOAP message and i don't know how to access it.
The resulting xml is
<folder>
<id S="ID-KMEHR" SV="1.0" SL="idfolder">1</id>
<patient>
<id S="ID-PATIENT" SV="1.0" SL=" ">05040199</...
Hi,
one of our classes use the bundled jaxb api of jdk 1.6. When I try to compile this using maven (JAVA_HOME is set to JDK 1.6 and it shows in the IDE that maven runs using JDK 1.6) I get a class not found error for the jaxb library. the class in question is present in rt.jar under JDK 1.6 lib folder. Any ideas???
...
I am having a rather frustrating issue trying to call a web service that requires an attachment.
This is the error:
Unexpected Attachment type =class
java.lang.Object
from here:
class="com.sun.xml.ws.client.sei.ResponseBuilder$AttachmentBuilder"
file="ResponseBuilder.java" line="250"
method="createAttachmentBuilder"
Th...
Hi,
I have the following regex type in my xsd file:
<xsd:simpleType name="Host">
<xsd:restriction base="xsd:string">
<xsd:pattern
value="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b">
</x...
I want to define an XML schema which allows elements like this:
<Element>TYPE1</Element>
<Element>TYPE2</Element>
<Element>TYPE3</Element>
<Element>Any Other Text</Element>
In this case, TYPE1, TYPE2 and TYPE3 are enumerated strings. However, the schema also allows any text content in Element.
This seems like a strange restriction. ...
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 some Args. For example, current code produces this XML:
<command>
<args>
<arg name="test_id">1234</arg>
<arg name="source"><html>EMAIL</html></arg>
</args>
</comm...
A very generalized and simplified scenario description:
Application builds JAXB instances through UI,
The JAXB instances are built in different steps are composed in the end,
As this is done, I must perform validation of the JAXB instances created in each step against the XSD to verify that the UI tier does not build nonsense.
Now t...
I would expect the following test to work with Sun's JAXB RI 2.2.1.1, but instead it fails with a NullPointerException in constructing the JAXBContext:
public class GenericFieldMarshallTest {
public static class CustomType {
}
public static class CustomTypeAdapter extends XmlAdapter<String, CustomType> {
@Override
...
I would like to convert a Java Object to a String containing the marshaled XML data. One of the ways I could find was to first marshal to a File and then read the file using BufferedReader to convert into a String. I feel this may not be the most efficient way, because the IO operations are performed twice (Once during marshaling and the...
I am wondering if it is possible to have JAXB not to create Java object for XML elements that serve as wrappers. For example, for XML of the following structure
<root>
<wrapper>
<entity/>
</wrapper>
</root>
I do not want an object for <wrapper> to be created at all. So for a class like
class Root {
private Entity ...
I am utilizing spring to do all of the marshalling/unmarshalling of my bean objects (via jaxb2Marshaller/WebServiceTemplate). For debugging purposes, I would like to be able to spit out the request/response XML. Does anyone know if this is possible? Thanks.
...
Hi,
I'm using JAXB to marshal a class that has an instance variable that's declared as class Foo. At runtime that instance variable is set to an instance of a subclass of Foo, let's say FooBar. There are basic JAXB annotations on both class Foo and FooBar.
The XML output shows that an instance of Foo is being marshaled instead of Foo...
I wonder if this is possible in jaxb2. I have a xml that can be either < element > or < element2 > it will never apear at the some time. They are both of type String and I want it to map to the same property in my java class. Is there a way in jaxb2 to configure that?
Thanks
Charlie
...
I'm very new to this, so go easy on me.
From my understanding, JAXB allows the programmer to use Java classes to write XML, and it takes care of creating the proper XML structure by reading XSDs. This way, when the schema changes, the programmer doesn't have to go back and rewrite a bunch of hard-coded XML because JAXB automatically tra...