Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Node -> XSDConcreteComponent
Node -> XSDConcreteComponent [message #592949] Wed, 01 December 2004 13:20
Eclipse UserFriend
Originally posted by: runinpanic.gmx.de

Hi,

I wish to find the corresponding XSDConcreteComponent-Object to a given
Node.

I have a XSDConcreteComponent and an XPath-Expression to get the node:

private void whatever(XSDConcreteComponent context, String xpath) {
Element root = context.getElement();
Node schemaNode = XPathAPI.selectSingleNode(root, xpath);
...
}

Now I need the XSDConcreteComponent the schemaNode points at. My first
plan was to create a hashtable of all given XSDConcreteComponents with
the Node as key. Is there a less time-consuiming way?


But there is another problem with these Nodes:

The XPaths point into an XMLSchema-File. Possible references in the
XMLSchema should be resolved. A Node pointing to a referred Element
should be translated into the resolved XSDConcreteComponent.


Example:

Schema:
<xs:complexType name="general">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="alpha"/>
<xs:group ref="beta"/>
<xs:group ref="gamma"/>
</xs:choice>
</xs:complexType>

<xs:complexType name="alpha">
...
</xs:complexType>

The context is the "general"-complexType-Element as XSDConcreteComponent.
The xpath is "/xs:choice/xs:group[1]".

The result-XSDConcreteComponent should be the resolved
"alpha"-complexType-Element.




Does someone has an idea how to implement such a method?

Thank you in advance
Hajo Hoffmann
Previous Topic:particle.getElement()
Next Topic:Node -> XSDConcreteComponent
Goto Forum:
  


Current Time: Thu Apr 25 12:41:03 GMT 2024

Powered by FUDForum. Page generated in 0.03330 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top