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
14 replies
Subscribers
9 subscribers
Views
7895 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
XML Format
sridevik7401
Certified Lead Developer
over 8 years ago
Hi,
How to convert a CDT to an XML format excluding XML Header information.
To achieve this requirement I used toxml() function but it is including XML Header as shown below.
<n1:EmployeeDetails xmlns:n1="EmployeeDetails">
<firstName>xyz</firstName>
<lastName>abc</lastName>
</n1:EmployeeDetails>
But I want result as shown below.
<firstName>xyz</firstName>
<lastName>abc</lastName>
OriginalPostID-259969
Discussion posts and replies are publicly visible
0
sparshs
over 8 years ago
You can use a java plugin for this. You can take help of jaxb to parse the xml in to the java object and then create a appian cdt from same java object.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chetany
A Score Level 1
over 8 years ago
How about using toxml() function and then manipulating its output by text functions. You can strip out the <n1:EmployeeDetails> from the output. You could try it with different text functions(cleanwith() and stripwith() come to mind) or use regex functions. There is one regex plugin in Shared components which allows replacing a pattern in a text.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sparshs
over 8 years ago
i agree with chetany his solution is much easy i guess.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sridevik7401
Certified Lead Developer
over 8 years ago
@chetany...I have tried stripwith() ,but it is removing all the characters wherever it is present.But i want to remove only in the XML header and footer .
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sridevik7401
Certified Lead Developer
over 8 years ago
@sparshs...could you please elaborate more on using java plugin
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@Sridevi Try creating an expression rule which accepts an input of type Text which holds value and another input which holds property, and return the response as XML Format, where the rule input which holds property, use it to form a Tag, and the input which holds the value, treat it as the value of this tag, and return , and in target place append the response into a local variable,
hope this can give you an alternate idea to achieve this
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
Is that okay if you get the below format?
<EmployeeDetails>
<firstName>xyz</firstName>
<lastName>abc</lastName>
</EmployeeDetails>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
xpathsnippet(jsontoxml(a!tojson(ri!test),"Root","T"), "//Root") tried this but cannot able remove the root node that is appended in jsontoxml
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sparshs
over 8 years ago
@Sridevik: What information you want basically regarding plugin , is it the flow or the architecture of plugin?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sridevik7401
Certified Lead Developer
over 8 years ago
@chandrasekharg...yes that format is what i exactly want..Even i used the xpathsnippet() but it is returning root node also.I want to exclude root node too.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>