Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Facets retrieving - getFacetContents
Facets retrieving - getFacetContents [message #603236] Mon, 25 August 2008 02:11
Muhamad Nazir is currently offline Muhamad NazirFriend
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: Thu Apr 25 00:29:09 GMT 2024

Powered by FUDForum. Page generated in 0.03017 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top