Home      Members   Calendar   Who's On

Welcome Guest ( Login | Register )
      

Home » BPM.NET 2007/Sharepoint Accelerator 2007 » BPM.NET 2007/Sharepoint Accelerator 2007 » Application Development » using...


using...Expand / Collapse
Author
Message
Posted Wednesday, July 01, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, July 27, 2009
Posts: 13, Visits: 21
Hi,

I am trying unsuccessfully to make use of the GetXmlNode function to get me a value of a certain column in a sharepoint list I have as an xmlVariable in my workflow.

this: CurrentContext.XmlVariables["Proc"].RawXml

gets me something like this:

<?xml version="1.0"?>
<List>
 <ListItem>
  <Proc_Y>
   <fieldname_x>text I want to get</fieldname_x>

...

 </ListItem>
</List>

So I Figured I could get the value like this:

XmlNode node = CurrentContext.XmlVariables["Proc"].GetXmlNode("/List/ListItem/Proc_Y/fieldname_x");

For some reason, this doesnt seem to get there...

I'd apreciate if if someone tells me what I'm doing wrong.

Post #1415
Posted Wednesday, July 01, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, December 21, 2009
Posts: 102, Visits: 124
Hi,

In the below piece of code, I suggest you to add another an additional / and then test the sceanario.

Your code:

XmlNode node = CurrentContext.XmlVariables["Proc"].GetXmlNode("/List/ListItem/Proc_Y/fieldname_x");

Recommended code: 

XmlNode node = CurrentContext.XmlVariables["Proc"].GetXmlNode("//List/ListItem/Proc_Y/fieldname_x");

Also, please find attached a word document(XMlVariableUsage.doc) which might help you on this.   Do get back to us for any further clarifications.

Thanks, Sri

Srinivasa Rao Pentapati

  Post Attachments 
XMlVariableUsage.doc (497 views, 54.00 KB)

Post #1416
Posted Wednesday, July 01, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, July 27, 2009
Posts: 13, Visits: 21
Hi Sri,

Thanks for your answer. i'll only be able to test it tomorrow, however, I think I have tried the double slash at the root of the xpath.

I also tried doing a foreach loop from an XMLVariableCollection (taking the value of the RawXML from the "PROC" variable,

that resulted in only 1 iteration (of course, silly me) but what I WASNT expecting is that instead of something like "//List" or "List" it was "$$List".

I'm wondering if the Xpath is formatted diferently because it is accessing a Sharepoint list "directly".

(Thanks for the Document, it will come in handy)

Post #1417
Posted Thursday, July 02, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, July 27, 2009
Posts: 13, Visits: 21
(Later)

Ok, I think I was able to narrow something down.

on the Sharepoint list, the column name I want to access is "PROC Y"

which in "sharepointish" is represented as: "Proc_x0020_Y"

And it appears exactly like that in the xml if I do a rawxml dump.

If I try to access "/List/ListItem", no problem. I get the node.

But if I go deeper and try to access "/List/ListItem/Proc_x0020_Y" it busts, with something like this:

System.Exception: Error while Getting Xml Node from Xml Variable-Proc-'/List/ListItem/Proc Y' has an invalid token.

Notice that the _x0020_ that was present in the rawXML seems to have been converted (or decoded).

But I cant seem to access it like:

"Proc Y", "Proc%20Y", "Proc_x0020_Y" or "Proc%95x0020%95Y".

Any idea how its getting encoded (im assuming) and how to access it?

Post #1423
Posted Thursday, July 02, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, July 27, 2009
Posts: 13, Visits: 21
Anyway, I worked around it...

XmlDocument oDoc = new XmlDocument();
    oDoc.InnerXml = CurrentContext.XmlVariables["Proc"].RawXml;

Using the XmlDocument from then on, was easy, and I got to the info I needed without any further problems.

There is something with the encoding in the Skelta version of the Xml Variables that was preventing me from accessing the info directly...

Post #1425
Posted Friday, July 03, 2009
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: Monday, December 21, 2009
Posts: 102, Visits: 124
Hi,

Thanks for letting me know that you got it working.  Please feel free to post your queries through Skelta forum or alternatively you can mail to support@skelta.com .

Thanks, Sri

Srinivasa Rao Pentapati

Post #1429
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
-
Active Users: 1 (1 guest, 0 members, 0 anonymous members)
No members currently viewing this topic.

All times are GMT -5:00, Time now is 4:10am

 
Execution: 0.125.15 queries.Compression Enabled.

Copyright © 2002 - 2009 Skelta Software. All rights reserved. Tel: 1 (678) 306 4110 | Email:sales@skelta.com
Skelta - A BPM Workflow Software Company