Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Trouble with getting XPath and/or namespace correct
Topic Summary:
Created On: 08/16/2012 07:02 AM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by ChrisThomas, on Thursday, August 16, 2012 2:32 PM

Answer:

Thank you, That helped.  I was able to create the loop and seperate the attributes i needed.  here is what i used.

 

 

 08/16/2012 07:02 AM
User is offline View Users Profile Print this message

Author Icon
ChrisThomas
Apprentice (20-49)

Posts: 41
Joined: 08/13/2012

Hello,

I need help with getting an elements out of this XML.  For example email.  In automate i initially got a namespace error.  so i specified all the names spaces when creating the xml session.  now i get a node not found when i attempt to retrieve the node.

example xpath which seems to work in xpath visualizer

/soapenv:Envelope/soapenv:Body/queryResponse/result/records

XML:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sf="urn:sobject.enterprise.soap.sforce.com"><soapenv:Body><queryResponse><result><done>true</done><queryLocator xsi:nil="true"/><records xsi:type="sf:User"><sf:Id xsi:nil="true"/><sf:Email>chris.thomas@somewhere.com</sf:Email><sf:FirstName>Chris</sf:FirstName><sf:LastName>Thomas</sf:LastName><sf:Username>christopher.thomas@somewhere.com</sf:Username></records><records xsi:type="sf:User"><sf:Id xsi:nil="true"/><sf:Email>jeremy.henderson@somewhere.com</sf:Email><sf:FirstName>Jeremy</sf:FirstName><sf:LastName>Henderson</sf:LastName><sf:Username>jeremy.henderson@somewhere.com</sf:Username></records><records xsi:type="sf:User"><sf:Id xsi:nil="true"/><sf:Email>noreply@chatter.salesforce.com</sf:Email><sf:LastName>Chatter Expert</sf:LastName><sf:Username>chat634663137e12@chatter.salesforce.com</sf:Username></records><size>3</size></result></queryResponse></soapenv:Body></soapenv:Envelope>

 08/16/2012 08:53 AM
User is offline View Users Profile Print this message

Author Icon
Ronak Patel
AUTOMATE EMPLOYEE

Posts: 967
Joined: 07/20/2006

Hi ChrisThomas,

I have attached sample task outlining how to parse Xml file with has Normal and Default namespaces.

Your Xml file contains this default namespace xmlns="urn:enterprise.soap.sforce.com".
When you use Create Xml Session activity on Xml action, you have to provide this namespace with dummy prefix(e.g. defaultPrefix). So, you can reference any xml element down the tree using that prefix (e.g. defaultPrefix:records)


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
// Ronak Patel,
// Automate Development Team
// Network Automation, Inc. - No Code, No Limits Business Process Automation
 08/16/2012 02:32 PM
User is offline View Users Profile Print this message

Author Icon
ChrisThomas
Apprentice (20-49)

Posts: 41
Joined: 08/13/2012

Answer Answer

Thank you, That helped.  I was able to create the loop and seperate the attributes i needed.  here is what i used.

 

 




Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1709 guests browsing this forum, which makes a total of 1709 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog