Benoit Maisonny wrote:
> 
> In the context of an XXE Java extension (a CSS extension, precisely),
> I'd like to find out what is the schema type of an element found in the
> document being edited. Assuming I have an Element node in XXE which is
> validated against an W3C XML Schema, I'd like to obtain the name of the
> element's complexType or simpleType.

Please note that some complexTypes and simpleTypes have no names at all.



> I know how to get an XXE ElementType
> Element dataElement = ...;
> DocumentType dataDocType = (DocumentType) dataElement
>       .getProperty(Constants.DOCUMENT_TYPE_PROPERTY);
> ElementType dataXxeType = dataDocType.getElementType(dataElement);
> 
> Now how do I obtain a concrete implementation of
> com.xmlmind.xml.wxs.validate.Type from there?
> 
> I keep browsing through the API without finding the link between the 2
> types of types.
> 

There is no public API which allows to do this.

Moreover, internally, this link is never needed, that's why there is
simply no way to obtain it. For example
com.xmlmind.xml.wxs.validate.ElementTypeImpl, which implements
ElementType, has package visibility.

You'll find the answer to this kind of questions by reading the source
code of the product.







Reply via email to