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
5 replies
Subscribers
7 subscribers
Views
2331 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I have an xml file with 200+ fields with the following format: <
fabienb
A Score Level 1
over 9 years ago
Hello,
I have an xml file with 200+ fields with the following format: <OPOPT1 lib="Option 01"></OPOPT1>
I have build a CDT with the same structure to use the torecord function but I am now wondering how I could use the "lib" information?
Any idea? Thank you for your help.
Best regards
OriginalPostID-138491
OriginalPostID-138491
Discussion posts and replies are publicly visible
0
Sathya Srinivasan
Appian Employee
over 9 years ago
Do you need a static CDT or a dynamic CDT? I think something worth thinking about is to build a rule that reads each elements and creates a type dynamically. like {lib:"option 01", ... ... ...} will give you a dynamic CDT with the contents of the XML.
Having said that, what does the XML do? I'm asking because there might be a better option to manage your requirement.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Malathi
Certified Lead Developer
over 9 years ago
Hi
You can add an attribute to your CDT XSD like,
<xsd:attribute name="lib" type="xsd:string"/>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
Thanks both for your answer.
Sathya- The CDT does not have to be dynamic. it is the output of a SOAP webservice. For now, I have a table that gives the "lib" attribute based on the element name but I was hoping that an appian function could do it.
Malthik- Once defined, how can I retrieve the attribute as a pv?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Andrew P Gramann
Certified Lead Developer
over 9 years ago
You could probably use the xpath expression functions, xpathdocument() or xpathsnippet(), to retrieve the attributes directly from the XML file.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fabienb
A Score Level 1
over 9 years ago
Thanks Andrew. For now, I have hard coded the "lib" attribute in a rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel