Okay, I got my simple Jaxb-Intros example to work by modifying the schema in the following
fashion:
I changed the schema from the original:
<?xml version="1.0" encoding="UTF-8"?>
| <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
| <xs:element name="UnitPrice">
| <xs:complexType>
| <xs:attribute name="value" type="xs:double"
use="required"/>
| </xs:complexType>
| </xs:element>
| </xs:schema>
to
<?xml version="1.0" encoding="UTF-8"?>
| <xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
| <xs:element name="UnitPrice">
|
| <xs:complexType>
| <xs:sequence>
| <xs:element name="value" type="xs:decimal"
maxOccurs="1" minOccurs="0"/>
| </xs:sequence>
| </xs:complexType>
|
| </xs:element>
|
| </xs:schema>
the XML file to be unmarshalled is now:
<?xml version="1.0" encoding="UTF-8"?>
| <UnitPrice xsi:noNamespaceSchemaLocation="C:\UnitPriceNew.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
| <value>40.0</value>
| </UnitPrice>
|
The working jaxb-intros config file now looks like this:
<?xml version = "1.0" encoding = "UTF-8"?>
| <jaxb-intros
xmlns="http://www.jboss.org/xsd/jaxb/intros">
| <Class name="junit.prices.UnitPrice">
| <XmlType name = "UnitPrice"/>
| <Field name="value">
| <XmlElement name="value" />
| </Field>
| </Class>
| </jaxb-intros>
|
Again, thanks for your suggestions and thanks for Jaxb-intros.
Regards,
Sylvia
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073405#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...