You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Elisha Berns <e....@computer.org> on 2005/07/13 22:49:36 UTC

PSVI Problems: Can't get enumeration facets

Hi,

I'm using the code below to get the count of the enumeration facets for
a simple type (the pST is an XSSimpleTypeDefinition pointer) and the
count always comes back as some totally bogus number like 9246.  I
checked the example code (in PSVIWriterHandlers.cpp) and see that it
does virtually the same thing.  So what could be wrong here?

XSMultiValueFacetList* pFL = pST->getMultiValueFacets();

if ( pFL == 0 )
	return 0;

unsigned int nSize = pFL->size();
if ( nSize == 0 )
	return 0;

unsigned int nCount = 0;

for ( unsigned int i = 0; i < nSize; i++ )
{
	XSMultiValueFacet* pMV = pFL->elementAt(i);
	if ( pMV->getFacetKind() ==
XSSimpleTypeDefinition::FACET_ENUMERATION )
	{
		StringList* pSL = pMV->getLexicalFacetValues();
		if ( pSL )
		{
			nCount = pSL->size();
		}
	}
}
return nCount;

Thanks for any help here,

Elisha Berns
e.berns@computer.org
tel. (310) 556 - 8332
fax (310) 556 - 2839




---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org