Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP Transported data feed- Transform needed

AyushiBami
Contributor II

I am trying  to integrate Archer with Sharepoint site url by using HTTP transporter data feed. In the transport tab, i am using a GET action type to connect with Data request URI and passing header parameters( authorization) as tested in Postman. For navigation, i am using JSON File Iterator as the site content for sharepoint is in JSON. I need to load a default transform/OOTB transform (required field) to convert JSON to XML . Can you please help with the default transform? Thanks

1 REPLY 1

Anonymous
Not applicable

Ayushi Bami,

 

You an find the JSON to XML transform on this page: XSLT: JSON to XML (Element Space Removal)

 

The following XSLT will convert JSON to XML and remove spaces between words that would be part of the element name.

Works with Archer 6.5+ due to requiring XSLT version 3.0 in order to use the json-to-xml function.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output indent="yes" method="xml"/>
<xsl:template match="record">
<xsl:copy>
<xsl:apply-templates select="json-to-xml(.)/*"/>
</xsl:copy>
</xsl:template>

<xsl:template match="*[@key]" xpath-default-namespace="http://www.w3.org/2005/xpath-functions">
<xsl:variable name="SpacesNoMore" select="translate(@key,' ', '_')"/>
<xsl:element name="{$SpacesNoMore}">
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍