REST API

The REST API is available at https://saas.deltaxml.com/api/content-compare/v1/XSLFO

Content Compare XSL-FO is a very simple REST API with two endpoints: /compare and /authorise.

Endpoint

Method

Description

Documentation

/compare

POST

comparison of two XML/FO files

POST /compare

/authorise

GET

refresh token

GET /authorise

POST /compare

Comparisons are posted using multipart/form-data to

https://saas.deltaxml.com/api/content-compare/v1/XSLFO/compare
CODE

Parameter

Description

inputA

REQUIRED

Input A to the comparison. We only display the changes in content from this version.

See information below on how to send input files.

inputB

REQUIRED

Input B to the comparison. We retain the structure of this input in the result file.

See information below on how to send input files.

outputType

Use xslfo (default) to get changes marked up with XSL-FO markup, or oxygen-tc to get output using Oxygen processing instructions

Authorisation

To make a comparison you will need to set the Authorization header to use your id as a Bearer token, for example:

Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
CODE

How to Send Input Files

Files can be sent in two ways: URLs, or as raw FO or XML.

URL inputs
For secure URLs set the Content-Type of the inputA/inputB to text/plain .
Here is an example:

...
----form-boundary-id
Content-Disposition: form-data; name="inputA"
Content-Type: text/plain

https://www.example.com/xslfo/inputA.fo
----form-boundary-id
...
CODE

Raw XML inputs
To send raw FO/XML you can send either a raw FO/XML string, or attach an FO/XML file.

Set the Content-Type of the inputA/inputB part to application/xslfo or text/xslfo.
Here is an example:

...
----form-boundary-id
Content-Disposition: form-data; name="inputA"
Content-Type: application/fo

<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <!-- defines page layout -->
    <fo:layout-master-set>
    <!-- layout for the first page -->
       ...etc...
----form-boundary-id
...
CODE

Responses

200 Successful comparison returns the comparison result.

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    ...
</fo:root>
CODE

GET /authorise

Get updated token information by using your refresh, id, and expiry information you downloaded earlier by passing them as query parameters to /authorise, for example:

GET https://saas.deltaxml.com/api/content-compare/v1/XSL-FO/authorise?refresh=ABCDEF123&expiry=1648141119&id=id
CODE

The response will be in the same JSON format you received when you requested your token.

Errors

400 Bad Request. Check the error message for details of what may need to be changed when you re-attempt the comparison. If you continue to receive an error, please contact support using our Customer Support Portal and report the error details.

500 Server Error. If you encounter these, please contact support using our Customer Support Portal and report the error details.

Errors will be reported with a parent element of <error> containing these child elements:

  • <errorMessage> - description of the error

  • <errorId> - unique ID to track errors

  • <errorCode> - the HTTP Response code

  • <timestamp> - ISO 8601 timestamp

An example of an error:

<error>
    <errorMessage>Parameter output-type value is invalid. Please choose from oxygen-tc or xslfo(default)</errorMessage>
    <errorId>8d395670-2e56-490d-9c3b-f87ee0154f81</errorId>
    <errorCode>400</errorCode>
    <timestamp>2022-03-24T14:19:29.516+0000</timestamp>
</error>
CODE

Restrictions

Only XSL-FO content can be compared. Files will be rejected by the API if they do not conform and you will receive an error.

If you’re getting an error message blocking your XSL-FO content from being compared, please contact DeltaXML.

Usage Limit

Trial users get 100 comparisons / month.

Paid subscribers get 1000 comparisons / month. To request more, please contact DeltaXML.

To see your current usage, go to Subscription Manager in MyDelta and find the relevant deal. Under the “Quantity” column will be information on your current usage level.

Input Size Limit

There is an input size limit of 5 Mb for each input file for trial users.

Ready to Subscribe?

If you’re ready to subscribe to Content Compare XSL-FO, please contact DeltaXML.