Name | Value | Default value | Description | ||
mode | async | sync | interactive | interactive |
Mode=async or mode=sync must be
specified, otherwise this request returns an
interactive Convert form.
The difference between
the two modes is explained below.
|
||
conv | The name of a conversion specification. | Required. |
Specifies which conversion is to be applied to the input
document.
|
||
paramI (I between 0 and 99) | Non-empty string. | None | Pass these extra parameters to the XSLT stylesheets referenced by the conversion specification. | ||
valueI | String. | None | Value of XSLTstylesheet parameter paramI. | ||
url | URL | One of url and file0 is required. | URL of the input document. May not have a fragment identifier (e.g. ends with "#foo"). | ||
fileI (I between 0 and 99) |
Uploaded file.
|
One of url and file0 is required. |
The input
document is contained in file0. Attachments (e.g. graphic
files) are contained in fileI, where I is an
integer between 1 and 99.
Alternatively, all the files may be
packed in a Zip archive. However this must be done exactly like in
the following example.
Let's suppose you want to convert
userguide.fo to RTF and
userguide.fo references several graphic files
found in subdirectory std/ . You'll have to
create userguide.fo.zip as follows:~/tmp$ ls sdt userguide.fo ~/tmp$ ls sdt drop-down-list-1.png drop-down-list-2.png ... ~/tmp$ zip -r userguide.fo.zip \ userguide.fo sdt ~/tmp$ ls sdt userguide.fo userguide.fo.zip
|
||
html | true | false | false | The input document must be parsed as HTML, and not as XML or XHTML (XHTML is a special kind of XML). | ||
out | String |
Same basename as the input file but with the extension
specified in the conversion specification (e.g. ".pdf" for
db5ToPDF).
If the conversion specification generates
a directory (e.g. ditaToXHTML), the contents of this
directory is packed in a Zip archive having the same basename of the
input file but with a ".zip" extension.
|
The basename of the result file. | ||
cache | true | false |
|
If true, cache the result of this
job.
Note that only the result of converting an URL can be
cached. The result of converting an uploaded file cannot be
cached.
|
||
auth | String. |
None.
Required and equal to
authorization1_token if the authorization1
server parameter has been specified.
|
Authorization token specified for conversion operations. |
$ curl 'http://localhost:8080/xslsrv/exec?op=convert&mode=async¬ &conv=xhtmlToPDF¶m0=root-id&value0=contents-box¬ &out=xfc.pdf¬ &html=true&url=http://www.xmlmind.com/foconverter/what_is_xfc.html' 7 $ curl -o xfc.pdf 'http://localhost:8080/xslsrv/exec/xfc.pdf?op=result&job=7' $ acroread xfc.pdf & $curl -o tutorial.zip 'http://localhost:8080/xslsrv/exec?op=convert&mode=sync¬ &conv=ditaToXHTML¬ &url=http://www.xmlmind.com/tutorials/DITA/src/tutorial.ditamap' $ unzip -v tutorial.zip
Name | Value | Default value | Description |
job | Integer larger than or equal to 0. | Required. | The ID of the job which is to be polled. |
from | Integer | 0. |
If specified job has successfully been executed, this
parameter is ignored.
Otherwise this parameter specifies the
index of the first progress message that should appear in the
downloaded log file. The first index is 0.
A negative index
means: return the end of the log file, that is, count messages
starting from the end of the log file rather than from its
beginning.
|
auth | String. |
None.
Required and equal to
authorization1_token if the authorization1
server parameter has been specified.
|
Authorization token specified for conversion operations. |
file -> job_status '\n' index_of_first_message '\n' message_count [ '\n' message ]* job_status -> CREATED|RUNNING|CANCELED|FAILED|DONE|CANCELING|CRASHED index_of_first_message -> Positive_Integer message_count -> Positive_Integer message -> start_message | step_count_message | step_message | progress_message | stop_message start_message -> START ' ' - step_count_message -> STEP_COUNT ' ' -1|Positive_Integer step_message -> STEP ' ' Positive_Integer progress_message -> MESSAGE ' ' ERROR|WARNING|INFO|VERBOSE|DEBUG ': ' Text_Line stop_message -> STOP ' ' -
$ curl -o 'http://localhost:8080/xslsrv/exec?op=poll&job=12345' UNKNOWN 0 0 $ curl -o 'http://localhost:8080/xslsrv/exec?op=poll&job=5' RUNNING 0 9 START - STEP_COUNT 4 STEP 0 MESSAGE INFO: Converting¬ "http://www.xmlmind.com/xmleditor/_distrib/demo/docbook/docbook-image.xml"¬ to "/opt/tomcat2/work/Catalina/localhost/xslsrv/cache/6/docbook-image.pdf"¬ using conversion specification "dbToPDF"... STEP 1 MESSAGE INFO: Compiling XSLT stylesheet¬ "/opt/tomcat2/webapps/xslsrv/addon/config/docbook/xsl/fo/docbook.xsl"...¬ MESSAGE INFO: XSLT stylesheet compiled in 0.0s. STEP 2 MESSAGE INFO: Transforming¬ "http://www.xmlmind.com/xmleditor/_distrib/doc/demo/docbook/docbook-image.xml"¬ to "/opt/tomcat2/work/Catalina/localhost/xslsrv/tmp/xslu8379/xslu5120.tmp"¬ using XSLT stylesheet¬ "/opt/tomcat2/webapps/xslsrv/addon/config/docbook/xsl/fo/docbook.xsl"... $ curl -o 'http://localhost:8080/xslsrv/exec?op=poll&job=5&from=-3' STEP 3 MESSAGE INFO: Converting "/opt/tomcat2/work/Catalina/localhost/xslsrv/tmp/xslu8379/xslu5120.tmp"¬ to "/opt/tomcat2/work/Catalina/localhost/xslsrv/cache/6/docbook-image.pdf"¬ using XSL-FO processor "FOP"... MESSAGE WARNING: [FOP WARNING] Font 'Symbol,normal,700' not found.¬ Substituting with 'Symbol,normal,400'.
Name | Value | Default value | Description |
job | Integer larger than or equal to 0. | Required. | The ID of the job whose execution is to be canceled. |
auth | String. |
None.
Required and equal to
authorization1_token if the authorization1
server parameter has been specified.
|
Authorization token specified for conversion operations. |
$ curl -'http://localhost:8080/xslsrv/exec?op=cancel&job=4' true $ curl -'http://localhost:8080/xslsrv/exec?op=cancel&job=4' true $ curl -'http://localhost:8080/xslsrv/exec?op=cancel&job=4' false
ImportantAs a simple
security check, the basename of the file which is the result of the job
must be passed in the request URL just after xslsrv/exec. See
examples below.
|
Name | Value | Default value | Description |
job | Integer larger than or equal to 0. | Required. | The ID of the job whose result is to be downloaded. |
auth | String. |
None.
Required and equal to
authorization1_token if the authorization1
server parameter has been specified.
|
Authorization token specified for conversion operations. |
$ curl -o docbook-table.pdf \ 'http://localhost:8080/xslsrv/exec/docbook-table.pdf?op=result&job=1' $ acroread docbook-table.pdf & $ curl -o dita-sample.zip \ 'http://localhost:8080/xslsrv/exec/dita-sample.zip?op=result&job=3' $ unzip -v dita-sample.zip $curl 'http://localhost:8080/xslsrv/exec/foo.bar?op=result&job=1234' HTTP Status 404 - the output of job #1234 is not available
Name | Value | Default value | Description |
job | Integer larger than or equal to -1. | Required. | The ID of the job whose result is to be discarded. -1 means: all jobs. |
auth | String. |
None.
Required and equal to
authorization2_token if the authorization2
server parameter has been specified.
|
Authorization token specified for administrative operations. |
~$ curl 'http://localhost:8080/xslsrv/exec?op=clear&job=12' 0 ~$ curl 'http://localhost:8080/xslsrv/exec?op=clear&job=-1' 2