Facets retrieving - getFacetContents [message #603236] |
Mon, 25 August 2008 02:11 |
Eclipse User |
|
|
|
Hi Ed and all,
I would like to know, what's the best way in retrieving facets. I noticed
a thread saying that we should use getFacetContents but which one should I
use in order to easily retrieve the facets, faster and better. Is it using
SimpleTypeDefinition or TypeDefinition directly?
I have something like this:
<!-- xsd snippet starts here -->
<xsd:complexType name="orderType">
<xsd:sequence>
<xsd:element name="noOfOrder" minOccurs="0" type="xsd:integer"/>
</xsd:sequence>
</xsd:complexType>
<!-- xsd snippet ends here -->
//java code starts here
XSDParticle particle = (XSDParticle)obj;
XSDElementDeclaration element = (XSDElementDeclaration)
particle.getContent();
if(null != element.getTypeDefinition()) {
XSDTypeDefinition typeDef = element.getTypeDefinition();
XSDSimpleTypeDefinition simpleTypeDef = null;
if(null != typeDef.getSimpleType()) {
simpleTypeDef = typeDef.getSimpleType();
// this is the question:
//should I use this simpleTypeDef here???? or is there any simpler
solution
}
}
Thanks.
~Nazir~
|
|
|
Powered by
FUDForum. Page generated in 0.04253 seconds