Hi Mukul,

Mukul Gandhi <[email protected]> wrote on 05/30/2009 07:20:37 AM:

> On Sat, May 30, 2009 at 4:36 PM, Mukul Gandhi <[email protected]>
wrote:
> > 1. I cannot do,
> > schemaGrammar.addGlobalTypeDecl(elementPSVI.getTypeDefinition());
> > if the type is an anonymous type.
> >
> > It seem, *I need to do this* to have a fully populated schema.
>
> It seems I have found the workaround (as below):
>
> I can do,
>
> XSTypeDefinition typeDef = elementPSVI.getTypeDefinition();
> if (!typeDef.getAnonymous()) {
>    schemaGrammar.addGlobalTypeDecl(elementPSVI.getTypeDefinition());
> }
>
> So, I do .addGlobalTypeDecl only if the type is not anonymous.

Right. By definition anonymous types are never global.

> So in this case, an XSElementDecl has all the necessary information.
> Therefore, the following call is sufficient for this example:
>
> schemaGrammar.addGlobalElementDecl((XSElementDecl)elementPSVI.
> getElementDeclaration());
>
> It seems, my problem is solved. But any comments on the approach I am
> following would be great..

Well, I didn't think you need to create a new SchemaGrammar. See my note
[1] on this from earlier in the month.

> --
> Regards,
> Mukul Gandhi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Thanks.>

[1] http://markmail.org/message/zq3hrqiygu24euwi

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [email protected]
E-mail: [email protected]

Reply via email to