I/O Types
Various types of IO are available:
IO Type | Merge Versions | Merge Result (Output) | XML Catalog | Notes |
---|---|---|---|---|
HTTP | ||||
File | ||||
Strings |
| Can only be used from multipart/form-data |
HTTP
HTTP URLs can be specified and the comparator will try to load the specified file.
This may involve the downloading of additional entities or other resources that are referenced by the specified file. Examples include:
DOCTYPE dtds
XML schema files using xsi association
General external XML entities referenced in the file
Resources specified using the XInclude mechanism
Examples
multipart/form-data
.....
Content-Disposition: form-data; name="A"
http://www.example.com/file1.xml
--boundary
.....
XML
In XML this is represented by setting the type
attribute on the I/O element to http
. The uri
child element is then used to set the HTTP URI.
<Version name="A" type="http">
<Uri>http://www.example.com/file1.xml</Uri>
</Version>
JSON
In JSON this is represented by setting the type
key to http
. The uri
key is then used to set the HTTP URI.
...
"Versions": [
{
"type": "http",
"name": "a",
"Uri": "http://www.example.com/file1.xml"
} ..etc..
]
...
File
This type of I/O is only appropriate when the REST service is being run 'on-premise'.
A file path (on the server) can also be used to specify the input, output, and catalog locations.
Examples
multipart/form-data
.....
Content-Disposition: form-data; name="A"
/Users/exampleUser/Documents/file1.xml
--boundary
.....
XML
In XML this is represented by setting the type
attribute on the I/O element to file
. The path
child element is then used to set the file path on the server.
<Version name="A" type="file">
<Path>/Users/exampleUser/Documents/file1.xml</Path>
</Version>
JSON
In JSON this is represented by setting the type
key to file
. The path
key is then used to set the file path on the server.
...
"Versions": [
{
"type": "file",
"name": "A",
"Path": "/Users/exampleUser/Documents/file1.xml"
} ..etc..
]
...
Strings
Raw XML strings can be used from multipart/form-data. To use this you need to set the Content-Type
of the part to application/xml
, text/xml
or application/html
.
This can be achieved either through uploading a file, or raw strings directly:
........
Content-Disposition: form-data; name="A"; filename="file1.xml"
Content-Type: text/xml
--boundary
Content-Disposition: form-data; name="B"
Content-Type: text/xml
<root><a/></root>
--boundary
.......