Node -> XSDConcreteComponent [message #55758] |
Wed, 01 December 2004 08:20  |
Eclipse User |
|
|
|
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
|
|
|
Re: Node -> XSDConcreteComponent [message #55787 is a reply to message #55758] |
Wed, 01 December 2004 08:34  |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------060403090002020701030205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hajo,
You can use XSDSchema.getCorrespondingComponent to find the component
for a given node, e.g.,
context.getSchema().getCorrespondingComponent(schemaNode)
I don't think XPath will let you traverse resolved refs, so I don't
think you can do what you want with XPath in that regard.
Hajo Hoffmann wrote:
>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
>
>
--------------060403090002020701030205
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hajo,<br>
<br>
You can use XSDSchema.getCorrespondingComponent to find the component
for a given node, e.g.,<br>
<blockquote> context.getSchema().getCorrespondingComponent(schemaNode)<br >
</blockquote>
I don't think XPath will let you traverse resolved refs, so I don't
think you can do what you want with XPath in that regard.<br>
<br>
<br>
Hajo Hoffmann wrote:
<blockquote cite="midruninpanic-39ACE1.14202001122004@eclipse.org"
type="cite">
<pre wrap="">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
</pre>
</blockquote>
<br>
</body>
</html>
--------------060403090002020701030205--
|
|
|
Re: Node -> XSDConcreteComponent [message #592960 is a reply to message #55758] |
Wed, 01 December 2004 08:34  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------060403090002020701030205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hajo,
You can use XSDSchema.getCorrespondingComponent to find the component
for a given node, e.g.,
context.getSchema().getCorrespondingComponent(schemaNode)
I don't think XPath will let you traverse resolved refs, so I don't
think you can do what you want with XPath in that regard.
Hajo Hoffmann wrote:
>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
>
>
--------------060403090002020701030205
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hajo,<br>
<br>
You can use XSDSchema.getCorrespondingComponent to find the component
for a given node, e.g.,<br>
<blockquote> context.getSchema().getCorrespondingComponent(schemaNode)<br >
</blockquote>
I don't think XPath will let you traverse resolved refs, so I don't
think you can do what you want with XPath in that regard.<br>
<br>
<br>
Hajo Hoffmann wrote:
<blockquote cite="midruninpanic-39ACE1.14202001122004@eclipse.org"
type="cite">
<pre wrap="">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
</pre>
</blockquote>
<br>
</body>
</html>
--------------060403090002020701030205--
|
|
|
Powered by
FUDForum. Page generated in 0.06634 seconds