You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Jeffrey Ai <je...@ekkon.com> on 2005/02/10 00:26:20 UTC

How to set the textnode value of a simple content complextype

Hello XMLBeaners,

I have a simple content complextype defined as below.  
----
	<xs:complexType name="ItemID">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="IDType"
type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
----

With the XMLBeans generated class , I can set the attribute IDType by
the following code.
    	ItemID itemID=pd.addNewItemID();
    	itemID.setIDType(uid);

But I'm not sure how to set the textnode value to an ItemID object from
the XMLBeans generated class.  There is no method for it.  

Thanks for any help.
Jeffrey Ai
 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: How to set the textnode value of a simple content complextype

Posted by Jeffrey Ai <je...@ekkon.com>.
I've found a way to do it.
-----
    	ItemID
itemID=ItemID.Factory.parse("<xml-fragment>"+uid+"</xml-fragment>");
    	pd.setItemID(itemID);
-----

Is there any better way to do it?
Thanks in advance.

Jeffrey Ai.

-----Original Message-----
From: Jeffrey Ai [mailto:jeffrey.ai@ekkon.com] 
Sent: Wednesday, February 09, 2005 3:26 PM
To: user@xmlbeans.apache.org
Subject: How to set the textnode value of a simple content complextype

Hello XMLBeaners,

I have a simple content complextype defined as below.  
----
	<xs:complexType name="ItemID">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="IDType"
type="xs:string"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
----

With the XMLBeans generated class , I can set the attribute IDType by
the following code.
    	ItemID itemID=pd.addNewItemID();
    	itemID.setIDType(uid);

But I'm not sure how to set the textnode value to an ItemID object from
the XMLBeans generated class.  There is no method for it.  

Thanks for any help.
Jeffrey Ai
 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org