Hi Peter,

The repetition information is saved in the content spec node
information of a SchemaElementDecl. So, you are right about checking the content spec node of elements. An element can have a sequence as it content spec node (e.g. min=2 max=unbounded), in case you want to check for that.
So, your code should work.
I noticed the following in your code snippet:
    >> if (!cSpecNode)
You need to remove the negation from the condition.

Regards,
Khaled

"Peter A. Volchek" wrote:

Line from *.xsd
<xsd:element name="A" type="TypeA" minOccurs="1" maxOccurs="unbounded"
nillable="true"/>

How could I get the information about minOccurs="1" maxOccurs="unbounded"
properties ?
I expected that following code will return mw what I want

    SchemaGrammar* grammar = (SchemaGrammar*)
parser.getValidator().getGrammar();
    RefHash3KeysIdPoolEnumerator<SchemaElementDecl> elemEnum =
grammar->getElemEnumerator();
    if (elemEnum.hasMoreElements())
    {
        while(elemEnum.hasMoreElements())
        {
            // Element's properties
            const SchemaElementDecl& curElem = elemEnum.nextElement();
            ContentSpecNode* cSpecNode = curElem.getContentSpec();

            if( !cSpecNode) {

    switch( cSpecNode->getType() )
    {
        case ContentSpecNode::Leaf:             cout << "Leaf"; break;
        case ContentSpecNode::ZeroOrOne:        cout << "ZeroOrOne"; break;
        case ContentSpecNode::ZeroOrMore:       cout << "ZeroOrMore"; break;
// That is what I need
    ...
    }

But this does not work
Could you suggest smth ?

Peter A. Volchek
Software Engineer
Metis International, Inc.
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to