Fetch JSON from an API
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
Fetch JSON from an API
I need to get a JSON file from API like this http://dme-intern.mozarteum.local/digit ... -info/4087
As far it seems that the extension would yield the needed result:
(cf. https://www.ibm.com/docs/en/datapower-g ... dpurl-open)
However, executing of this code
triggers a Saxon error "Unknown extension instruction".
I suppose the extension should be declared somewhere. Am I correct? How to do it in oXygen (25.0, build 2023013006)?
P.S. I've searched in the Oxygen documentation for "Saxon extension" and also Saxon documentation like this section:
https://www.saxonica.com/html/documenta ... nsibility/
but did not find what I need.
Regards,
Oleksii
As far it seems that the extension
Code: Select all
dp:url-open
(cf. https://www.ibm.com/docs/en/datapower-g ... dpurl-open)
However, executing of this code
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<stylesheet exclude-result-prefixes="xs xd dme functx dp" version="3.0"
xmlns:dp="http://www.datapower.com/extensions" extension-element-prefixes="dp"
xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:dme="http://www.mozarteum.at/ns/dme"
xmlns:functx="http://www.functx.com" xmlns:map="http://www.w3.org/2005/xpath-functions/map"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xpath-default-namespace="http://www.music-encoding.org/ns/mei">
<template match="/">
<result-document href="out.txt">
<dp:url-open target="http://dme-intern.mozarteum.local/digital-editions/api/work-info/4087"
> </dp:url-open>
</result-document>
</template>
</stylesheet>
I suppose the extension should be declared somewhere. Am I correct? How to do it in oXygen (25.0, build 2023013006)?
P.S. I've searched in the Oxygen documentation for "Saxon extension" and also Saxon documentation like this section:
https://www.saxonica.com/html/documenta ... nsibility/
but did not find what I need.
Regards,
Oleksii
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
-
- Posts: 159
- Joined: Mon Nov 24, 2014 1:49 pm
- Location: Greven/Germany
Re: Fetch JSON from an API
Hi,
I'm not familiar with this extension. What we do is to download the JSON with curl from Apache Ant first. Then we convert the JSON to XML and then we operate normally on the XML. This is surely the slowest solution, but very easy to maintain.
Best regards
I'm not familiar with this extension. What we do is to download the JSON with curl from Apache Ant first. Then we convert the JSON to XML and then we operate normally on the XML. This is surely the slowest solution, but very easy to maintain.
Best regards
stefan-jung.org – Your DITA/DITA-OT XML consultant
-
- Posts: 84
- Joined: Wed Jul 19, 2017 6:04 pm
- Location: Austria
- Contact:
Re: Fetch JSON from an API
Thank you for the feedback!
Currently I suppose to go this path: https://stackoverflow.com/a/75661104/7315908
Currently I suppose to go this path: https://stackoverflow.com/a/75661104/7315908
Kind regards,
Oleksii Sapov-Erlinger
Oleksii Sapov-Erlinger
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