Kinook Software Forum

Kinook Software Forum (https://www.kinook.com/Forum/index.php)
-   [VBP] General Discussion (https://www.kinook.com/Forum/forumdisplay.php?f=2)
-   -   XPath Help (https://www.kinook.com/Forum/showthread.php?t=2793)

Too_Tall_Crown_Victoria 07-13-2007 04:15 PM

XPath Help
 
I am trying to understand how to use xpath and VBP. I have an xml file that will contain the owners of each of our modules. The format is as follows:




. . .


I was using a Step Property action with a value:

[%READ_XML(D:\build\owners.xml,/Component/owner=@module name=%MY_PROJECT%)%]

All I get are errors.

I can get this to work if I use the format:



bob@bob.com


tim@tim.com

. . .


However I am told that this is not a properly formatted xml file.

Thanks for your help.

kinook 07-16-2007 08:02 AM

Both a valid XML, although the second one would be difficult to define a schema for.

/Component/owner=@module name=xyz

is not valid XPath. I'm not sure what you're actually trying to retrieve from the XML file?

Here some XPath tutorials:
http://www.google.com/search?hl=en&q=xpath+tutorial
http://en.wikipedia.org/wiki/XPath#External_links

Too_Tall_Crown_Victoria 07-16-2007 08:57 AM

Here is my new XPath command:

[%READ_XML(D:\build\owners.xml,/Component//module[@name=%MY_PROJECT%)%]

This works but I get a blank macro.

A co-worker of mine is suggesting that the READ_XML macro is not capable of reading and returning just the value of owner. As they cannot find anyway for XPATH to return a specific item in the attribute field.

Do I need to use another tool to get this information?

Too_Tall_Crown_Victoria 07-16-2007 09:04 AM

I have even tried:

[%READ_XML(D:\build\owners.xml,/Component//module[@name=%MY_PROJECT%/@owner)%]

It does not fail but I get no results. When I need to recieve bob@bob.com for example.

kinook 07-17-2007 10:32 AM

%READ_XML(D:\build\owners.xml,/component/module[@name='ProjB']/@owner)%


All times are GMT -5. The time now is 08:50 AM.


Copyright © 1999-2023 Kinook Software, Inc.