<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to generate xml document with dynamic data</title><link>https://community.appian.com/discussions/f/general/9162/how-to-generate-xml-document-with-dynamic-data</link><description>Hi, I have a scenario to generate XML document with dynamic data .Need to take data through an action then automatically required XML document should be generated Could you please help me on this OriginalPostID-255853</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130377?ContentTypeID=1</link><pubDate>Fri, 01 Mar 2024 12:42:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:60da64d3-b48c-47fc-a8c8-a4dd2a56a38c</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;Thanks a lot&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130327?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 16:44:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ec2ea34b-09be-43c5-ab10-27c70984ffce</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(

  local!valor: &amp;quot;&amp;lt;n1:root xmlns:n1=&amp;quot;&amp;quot;root2&amp;quot;&amp;quot; xmlns:a=&amp;quot;&amp;quot;&amp;gt;www.appian.com/.../2009&amp;quot;&amp;quot; xmlns:xsd=&amp;quot;&amp;quot;&amp;gt;www.w3.org/.../XMLSchema&amp;quot;&amp;quot; xmlns:xsi=&amp;quot;&amp;quot;&amp;gt;www.w3.org/...&amp;gt;&amp;lt;/n1:root&amp;gt;&amp;quot;,

  regexreplaceall(&amp;quot;\sxmlns[^&amp;quot;&amp;quot;]+&amp;quot;&amp;quot;[^&amp;quot;&amp;quot;]+&amp;quot;&amp;quot;&amp;quot;, local!valor, &amp;quot;&amp;quot;)

)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try this....&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130320?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 15:46:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3f51e76-318d-4422-b451-8ccc65a46340</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Regexes in Appian are not different to other languages. Get the plugin installed and check stackoverflow or other resources.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130319?ContentTypeID=1</link><pubDate>Thu, 29 Feb 2024 15:45:07 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7f263db-20d9-4ed0-9bfc-863f8336ad19</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;thanks David,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you please give a more detailed example?&lt;/p&gt;
&lt;p&gt;I am not too familiar with regular expressions in Appian&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;like how to remeove the header and footer from previous generated xml&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;n1:root xmlns:n1=&amp;quot;root2&amp;quot; xmlns:a=&amp;quot;&lt;a href="http://www.appian.com/ae/types/2009"&gt;&amp;quot;&amp;gt;www.appian.com/.../2009&amp;quot;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;xmlns:xsd=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;&amp;quot;&amp;gt;www.w3.org/.../XMLSchema&amp;quot;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;&amp;quot;&amp;gt;www.w3.org/.../&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;n1:root&amp;gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130190?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 16:56:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2a1b377e-92db-45c2-a10d-4290c201722f</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Use regular expressions in order to remove the namespaces from the resulting xml, for example&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;\sxmlns[^"]+&amp;quot;[^"]+&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130188?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 16:16:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3e50b3eb-5709-43fc-959a-beb50d4ed6be</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;much better now!&lt;/p&gt;
&lt;p&gt;last to remove are&amp;nbsp;the &lt;strong&gt;&amp;quot;xsi:type&amp;quot;&lt;/strong&gt; data&amp;nbsp; and the&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;lt;n1:root xmlns:n1=&amp;quot;root2&amp;quot; xmlns:a=&amp;quot;&lt;a href="http://www.appian.com/ae/types/2009"&gt;&amp;quot;&amp;gt;www.appian.com/.../2009&amp;quot;&lt;/a&gt; xmlns:xsd=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;&amp;quot;&amp;gt;www.w3.org/.../XMLSchema&amp;quot;&lt;/a&gt; xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;&amp;quot;&amp;gt;www.w3.org/.../n1:root&amp;gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;n1:root xmlns:n1=&amp;quot;root2&amp;quot; xmlns:a=&amp;quot;&lt;a href="http://www.appian.com/ae/types/2009"&gt;&amp;quot;&amp;gt;www.appian.com/.../2009&amp;quot;&lt;/a&gt; xmlns:xsd=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema"&gt;&amp;quot;&amp;gt;www.w3.org/.../XMLSchema&amp;quot;&lt;/a&gt; xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;&amp;quot;&amp;gt;www.w3.org/.../XMLSchema-instance&amp;quot;&amp;gt;&lt;/a&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;one xsi:type=&amp;quot;a:Map&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; &amp;lt;two xsi:type=&amp;quot;xsd:dateTime&amp;quot;&amp;gt;2024-02-27T16:13:19.700Z&amp;lt;/two&amp;gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;/n1:root&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;possible with parameters only?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130184?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 14:56:02 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f372b942-f472-4107-96bd-733972b7ee49</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;That seems to be the standard with record type data. Did you try to cast the data to maps?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cast(
  type!Map,
  &amp;lt;your data&amp;gt;
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130183?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 14:52:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c0dd27f8-7c34-4c01-b89f-be1b27e870dc</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;toxml(&lt;br /&gt;&amp;nbsp; &amp;nbsp; value:a!map(&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; one:rule!ZMK_GetDEMANDEByIddemande(1),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; two: now()&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;),&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;format:true,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;name:&amp;quot;root&amp;quot;,&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;namespace:&amp;quot;root2&amp;quot;&lt;br /&gt;)&lt;/p&gt;
&lt;p&gt;and the result is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;&amp;quot;&amp;lt;n1:root xmlns:n1=&amp;quot;root2&amp;quot; xmlns:a=&amp;quot;http://www.appian.com/ae/types/2009&amp;quot; xmlns:xsd=&amp;quot;http://www.w3.org/2001/XMLSchema&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt; &amp;lt;one xmlns:n2=&amp;quot;urn:com:appian:recordtype:datatype&amp;quot; xsi:type=&amp;quot;n2:4d150a11-17bc-4370-b1d6-5db2f05a6bda&amp;quot;&amp;gt; &amp;lt;iddemande xsi:type=&amp;quot;xsd:int&amp;quot; uuid=&amp;quot;f7dfcec7-9a6f-44f2-ac39-651317a0cf9d&amp;quot;&amp;gt;1&amp;lt;/iddemande&amp;gt; &amp;lt;statut xsi:type=&amp;quot;xsd:string&amp;quot; uuid=&amp;quot;f41f320f-ff4a-4077-a59b-75960d9310c7&amp;quot;&amp;gt;NEW&amp;lt;/statut&amp;gt; &amp;lt;dateStatut xsi:type=&amp;quot;xsd:string&amp;quot; uuid=&amp;quot;76b39c40-b653-44e6-901d-6697f1281513&amp;quot; /&amp;gt; &amp;lt;statusId xsi:nil=&amp;quot;true&amp;quot; xsi:type=&amp;quot;xsd:int&amp;quot; uuid=&amp;quot;76534201-8a54-4fc0-a951-0459d7d690d8&amp;quot; /&amp;gt; &amp;lt;idremise xsi:nil=&amp;quot;true&amp;quot; xsi:type=&amp;quot;xsd:int&amp;quot; uuid=&amp;quot;63dd9e79-b738-40d1-af3b-a452e470b4e6&amp;quot; /&amp;gt; &amp;lt;topUrgence xsi:nil=&amp;quot;true&amp;quot; xsi:type=&amp;quot;xsd:boolean&amp;quot; uuid=&amp;quot;0bbc73b0-88dd-4bbb-8f6f-68fe62e72f90&amp;quot; /&amp;gt; &amp;lt;createdBy a:id=&amp;quot;&amp;quot; xsi:type=&amp;quot;a:User&amp;quot; uuid=&amp;quot;c4af67cd-1d10-44ce-9b92-3000ffe0a602&amp;quot; /&amp;gt; &amp;lt;createdOn xsi:nil=&amp;quot;true&amp;quot; xsi:type=&amp;quot;xsd:dateTime&amp;quot; uuid=&amp;quot;b173133d-de4d-4c94-9dbc-5667a57a507a&amp;quot; /&amp;gt; &amp;lt;modifiedBy a:id=&amp;quot;&amp;quot; xsi:type=&amp;quot;a:User&amp;quot; uuid=&amp;quot;1692f2fd-e43b-46ae-beb3-2b4fb9cb88ac&amp;quot; /&amp;gt; &amp;lt;modifiedOn xsi:nil=&amp;quot;true&amp;quot; xsi:type=&amp;quot;xsd:dateTime&amp;quot; uuid=&amp;quot;11eff0d9-0aa6-44ff-b0ab-fdb9cc98397e&amp;quot; /&amp;gt; &amp;lt;/one&amp;gt; &amp;lt;two xsi:type=&amp;quot;xsd:dateTime&amp;quot;&amp;gt;2024-02-27T14:36:20.060Z&amp;lt;/two&amp;gt; &amp;lt;/n1:root&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With no formatting , UUID instead of field names and still have the xmlns and xsi2:type metadata...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130160?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 10:35:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:767a172e-749e-429f-82f1-e9f22a2b2feb</guid><dc:creator>David Jimenez </dc:creator><description>&lt;p&gt;Could you post your code here? Stefan solutions seems to be correct..... Maybe there is some kind of error in your code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130153?ContentTypeID=1</link><pubDate>Tue, 27 Feb 2024 08:55:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e2d2b3ca-090f-476e-9fe9-4b02b0a5602e</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;I&amp;#39;ve tried them without success so yes it seems like there will be no choice than using substitute unless someone has a better solution&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130112?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 17:29:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:065d1765-a183-40ff-842f-3a5a27894f5f</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;toxml has a few parameters. Try these. And yeah, I know that the resulting XML is not clean. In the past, I had to remove some strings manually using substitute()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130109?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 17:20:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3fae99aa-6cf3-49fe-9332-556c831689b0</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;thanks Stefan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How do I make it basic, without all the &lt;strong&gt;a:map&lt;/strong&gt; and &lt;strong&gt;xlmns&lt;/strong&gt; within the xml?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;thanjs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130070?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 10:50:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ea38b10-ca4a-4859-847e-ffac940d2503</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Just use toxml() and write that into a text document using&amp;nbsp;&amp;quot;template.xml&amp;quot; and the smart service described above.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/11/pastedimage1708944594643v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/130069?ContentTypeID=1</link><pubDate>Mon, 26 Feb 2024 10:37:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4d35f88d-840d-44fb-9199-0c9b545e2b8c</guid><dc:creator>mokc0038</dc:creator><description>&lt;p&gt;Is there any update on this?&lt;/p&gt;
&lt;p&gt;Typically would like to generate an xml file with dynamic date (coming from record) based on an xsd&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What would be the most efficient way to do so?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/40960?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 13:47:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8c87f38f-6396-433d-971d-4a07cc801a13</guid><dc:creator>georgej</dc:creator><description>Custom java plugins may come handy ,but as such in my limited knowledge there are no ootb for serializing an object. We used to handle this situation using string concatenation inside rules. Inside the rule an xml template will be placed, with appropriate place holders as incoming parameters. Basically the rule returns a well formatted XML document with the provided parameters.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/40954?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 12:37:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:000d61e1-93e5-43b4-927e-b712cf199775</guid><dc:creator>chetany</dc:creator><description>If the dynamic data is in CDT format, the toxml() function should be of use to you.&lt;br /&gt;Once the dynamic data is converted to XML string, use the &amp;quot;Text Doc from Template&amp;quot; smart service. In the template, specify a text file containing a single placeholder for the XML.&lt;br /&gt;Then just rename the file extension to .xml using the &amp;quot;Edit Document&amp;quot; smart service.&lt;br /&gt;Since XML files are basically text files, you can leverage the &amp;quot;Text Doc from Template&amp;quot; smart service.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to generate xml document with dynamic data</title><link>https://community.appian.com/thread/40951?ContentTypeID=1</link><pubDate>Tue, 03 Jan 2017 11:23:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1389eb86-2b20-492c-adaa-04efd585100a</guid><dc:creator>sparshs</dc:creator><description>You can use java for this. You can create a Appian plugin for this.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>