Hi Adrien,

At 11.40 05/10/2005 +0200, a\.desentenac wrote:
Hi Alberto

> You can get the enumeration from the
> DatatypeValidator object by invoking getEnumString().

Well i'd like to try to avoid using DatatypeValidator since i
got it null on anonymous simple type, and i have a few of them
in the XSD i have to use.

I still have to find the time to look into this issue... do you have a very simple testcase?


> If you prefer navigating the XSxxxx type
> hierarchy, you should first build the XSModel
> object from the grammar by calling
> parser->getGrammarResolver()->getXSModel(). After
> that, you can get the element declaration by
> using XSModel::getElementDeclaration(typeName, typeURI).

It seems getGrammarResolver() is protected, so i got the
XSModel from the XMLGrammarPool associated to my
DOMBuilderImpl parser, but now i don't now what argument to
give the getElementDeclaration(), i tried getting the
DOMTypeInfo of the DOMElement and using the getName() and the
getNamespace() as parameters then i tried getLocalName() and
getNamespaceURI() of the DOMElement, but either didn't work.

You should use getLocalName/getNamespaceURI, but keep in mind that getElementDeclaration only works for global elements. If you are looking to a local element you should use getTypeDefinition(typeName, typeURI). If you are looking at an anonymous declaration you should go up in the DOM tree until you find an element that either is a global element, or uses a global type: at that point, navigate that definition downwards.

Alberto


I have still some trouble seeing how every class interact with
each other.

Sorry to bother, and thanks for your help.
Regards,
Adrien de Sentenac Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34€/mn) ; tél : 08 92 68 13 50 (0,34€/mn)


Reply via email to