Use the factory method.
Thanks,
Andy
-----Original Message-----
From: Steven Crosley [mailto:[EMAIL PROTECTED]
Sent: 02 April 2008 21:55
To: [email protected]
Subject: How do I set a string element of a type object?
Hi,
I'm trying to set an element value that is a complex type, but I had to add an
attribute to the element so I can no longer call it like this:
book.setTitle(rs.getString("title"));
I now get this message:
The method setTitle(TitleType) in the type Book is
not applicable for the arguments (String)
So, how do I convert the String to the TitleType object?
My XSD looks something like this:
<xs:element type="tns:titleType" name="title"/>
<xs:complexType name="titleType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:boolean" name="lost"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Thanks,
Steven