This content has been marked as final.
Show 3 replies
-
1. Re: jaxb whitepsace handling
aloubyansky Jul 12, 2007 6:07 AM (in response to starksm64)Is this really JAXB or JBossXB?
JBossXB used to trim whitespaces by default. But then we had this thread http://www.jboss.com/index.html?module=bb&op=viewtopic&t=110310 -
2. Re: jaxb whitepsace handling
adrian.brock Jul 12, 2007 10:01 AM (in response to starksm64)The example you post is NOT valid, you're missing the
managed-connection-factory-class element.
Have you enabled validation on the parser?
You'll need it if you want whitespace collpasing by the parser
because its gots to read the schema to find out the datatype.
e.g. in your case it should be<connection-definition> <managed-connection-factory-class> org.jboss.resource.adapter.jms.JmsConnectionFactory </managed-connection-factory-class> </connection-definition>
managed-connection-factory-class is a j2ee:fully-qualified-classType
which is a j2ee:string which is a token.
See javaee.xsd<xsd:complexType name="string"> <xsd:annotation> <xsd:documentation> This is a special string datatype that is defined by Java EE as a base type for defining collapsed strings. When schemas require trailing/leading space elimination as well as collapsing the existing whitespace, this base type may be used. </xsd:documentation> </xsd:annotation> <xsd:simpleContent> <xsd:extension base="xsd:token"> <xsd:attribute name="id" type="xsd:ID"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType>
-
3. Re: jaxb whitepsace handling
starksm64 Jul 12, 2007 11:09 AM (in response to starksm64)Its the tx-connection-factories-ds.xml that is being parsed, not the ra.xml so there is no schema associated with the file. I was able to resolve the issue by using the existing javax.xml.bind.annotation.adapters.CollapsedStringAdapter type adapter:
/** The connectionDefinition */ @XmlElement(name="connection-definition") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String connectionDefinition;