Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2008

Tip: Looking for answers? Try searching our database.

XPath and indexes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
-- - 23 Apr 2008 15:43 GMT
Image I've got a schema similar to this:
<Root>
<Xs>
 <X>X Item 1</X>
 <X>X Item 2</X>
 <X>X Item 3</X>
 <X>X Item 4</X>
</Xs>
<Ys>
 <Y>Y Item 1</Y>
 <Y>Y Item 2</Y>
 <Y>Y Item 3</Y>
 <Y>Y Item 4</Y>
</Ys>
</Root>

I would like an (Infopath 03 compatible) XPath expression, such that
when it's executed in the context of a Y node, returns the
corresponding X node.  So if executed in <Y>Y Item 3</Y>, it returns
<X>X Item 3</X>.
Anyone have any idea how to accomplish this?  Is it even possible.

I'm thinking the solution is something like:
/Root/Xs/X[position() = ???]
I just have no idea what to put in the ???, how to I get the position
of the initial context node?
Greg Collins - 30 Apr 2008 20:52 GMT
If this is in the context of a Y node, and the content of X and Y will be
identical, then you would use something like:

/Root/Xs/X[. = current()]

Signature

Greg Collins
Microsoft MVP
Visit Braintrove at http://www.braintrove.com
Visit InfoPathDev at http://www.infopathdev.com

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.