Output from document() is not formatted
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Fri Aug 10, 2018 7:08 am
Output from document() is not formatted
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 ?
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Output from document() is not formatted
Hi,
Maybe instead of xsl:value-of you should use "xsl:copy-of" instead, otherwise all the XML tags will be stripped from the copied content.
About the authentication, maybe it would be better to do that outside of the XSLT, have an ANT build file which downloads the necessary XML document from the web using authentication, then it stores it locally and invokes the XSLT stylesheet which reads the local XML and processes it.
Regards,
Radu
Maybe instead of xsl:value-of you should use "xsl:copy-of" instead, otherwise all the XML tags will be stripped from the copied content.
About the authentication, maybe it would be better to do that outside of the XSLT, have an ANT build file which downloads the necessary XML document from the web using authentication, then it stores it locally and invokes the XSLT stylesheet which reads the local XML and processes it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service