Context Node Missing Data

G

GGian

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
 
S

Steve van Dongen [MSFT]

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!!

Attributes don't have a parentNode. node.selectSingleNode("..") will
return the parent node for a node of any type.

Regards,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top