Output from document() is not formatted
Posted: Fri Aug 10, 2018 7:22 am
Hello All,
I am new to XSLT & looking for the way to get formatted result from xslt.
Basically, I am invoking simple REST API through xslt as below -
Output I see is - 111Asia/Kolkata
If I run the same API through Postman, I return as below -
I have another question about passing authentication, not sure its relevant here but any thought/guideline will be helpful.
Query is, while executing this API through xslt. Is there any way, we can pass user/password on API through xslt ?
I am new to XSLT & looking for the way to get formatted result from xslt.
Basically, I am invoking simple REST API through xslt as below -
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="/">
<xsl:variable name="REST_response2"
select="document('http://localhost:8800/wmshead_fwh_django/wms/lgfapi/v9/entity/facility/647/facility_time_zone')" />
<code1>
<xsl:value-of select="$REST_response2" />
</code1>
</xsl:template>
</xsl:stylesheet
If I run the same API through Postman, I return as below -
Code: Select all
{
"result_count": 1,
"page_count": 1,
"page_nbr": 1,
"next_page": null,
"previous_page": null,
"results": [
{
"code": "Asia/Kolkata"
}
]
}
Query is, while executing this API through xslt. Is there any way, we can pass user/password on API through xslt ?