I have a script that builds the XPath of the current contect node. It does
this by getting the current context node and following the parent nodes until
there are no more parents. This works great when i define the schema in
infopath. For some reason, when my schema comes from a database or
webservice, the context node returned from GetContextNodes seems to be
missing a lot of information. Most importantly the parentNode is NULL. Does
anyone know why this might be the case?
For example:
for a node with XPath: "/myFields/queryFields/base/ID"
this node is bound to a text box. When i click in the text box, i would
expect the context node to be "ID" and have a parent "base". This is how it
works when my schema is built in infopath. but not for my current form which
has a schema from a database. Any suggestions would be great!!
-Greg
Steve van Dongen [MSFT] - 24 Sep 2004 20:45 GMT
>I have a script that builds the XPath of the current contect node. It does
>this by getting the current context node and following the parent nodes until
[quoted text clipped - 11 lines]
>works when my schema is built in infopath. but not for my current form which
>has a schema from a database. Any suggestions would be great!!
Attributes don't have a parentNode. node.selectSingleNode("..") will
return the parent node for a node of any type.
Regards,
Steve
--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm