Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Facets retrieving - getFacetContents
Facets retrieving - getFacetContents [message #603236] Mon, 25 August 2008 02:11
Muhamad Nazir is currently offline Muhamad Nazir
Messages: 24
Registered: July 2009
Junior Member
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~
Previous Topic:Format of serialized XML
Next Topic:Facets retrieving - getFacetContents
Goto Forum:
  


Current Time: Tue Sep 02 21:21:35 GMT 2014

Powered by FUDForum. Page generated in 0.10076 seconds