Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
9 subscribers
Views
3378 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Here we go...another XML question :) I was under the impression that
karlaw
over 12 years ago
Here we go...another XML question :)
I was under the impression that using this type of syntax would check to see if a tag exists however, it's really only checking to see if there is any value in an existing tag.
if( (xpathsnippet(pv!accountResponseBody_Txt, "//*[local-name(.)='ProductTypeCode']/text()")) = "", "", xpathsnippet(pv!accountResponseBody_Txt, "//*[local-name(.)='ProductTypeCode']/text()") )
What I need to do is determine if a child tag exists or not. If it exists, I want to take the value. If it doesn't, I don't want to store an empty string value in the CDT equivalent field.
Any ideas how the syntax would look for that?...
OriginalPostID-60871
OriginalPostID-60871
Discussion posts and replies are publicly visible
Parents
0
karlaw
over 12 years ago
No luck....no value is being stored in the test boolean. I cut/paste right from the forum. For the account I am using, there are 0 instances of ProductTypeCode so I left the [1]. The application will be looking for multiple instances of ProductTypeCode...it is in a child object <Account> that can repeat any number of times. I want to save the <ProductTypeCode> value when the tag exists and when the tag doesn't exist, I want to save an empy string. All of this will go into a multple PV array.
aTempAccount_Ary
CustomerID
AccountID
ProductTypeCode
XML Response Structure
<GetCustomerAccountsResponse>
<GetCustomerAccountsResponseMessage>
<Customer>
<Accounts>
<Account>
<ProductTypeCode>
</Account>
<Account>
**missing ProductTypeCode tag
</Account>
<Account>
<ProductTypeCode>
</Account>
</Accounts>
</Customer>
</GetCustomerAccountsResponseMessage>
</GetCustomerAccountsResponse>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
karlaw
over 12 years ago
No luck....no value is being stored in the test boolean. I cut/paste right from the forum. For the account I am using, there are 0 instances of ProductTypeCode so I left the [1]. The application will be looking for multiple instances of ProductTypeCode...it is in a child object <Account> that can repeat any number of times. I want to save the <ProductTypeCode> value when the tag exists and when the tag doesn't exist, I want to save an empy string. All of this will go into a multple PV array.
aTempAccount_Ary
CustomerID
AccountID
ProductTypeCode
XML Response Structure
<GetCustomerAccountsResponse>
<GetCustomerAccountsResponseMessage>
<Customer>
<Accounts>
<Account>
<ProductTypeCode>
</Account>
<Account>
**missing ProductTypeCode tag
</Account>
<Account>
<ProductTypeCode>
</Account>
</Accounts>
</Customer>
</GetCustomerAccountsResponseMessage>
</GetCustomerAccountsResponse>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data