Please note: CPAINT nor this website is under active development. |
Response/Data Formats Supported
The CPAINT backend can return data to the frontend in either XML or plain-text format. Here is a list of formats we have tested and which option you should use with set_response_type when setting up the connection in the frontend. These formats work with the remote proxy utility as well.
SGML/XML-based formats
If you wish to use CPAINT to transform these into a JavaScript array or write your own parser in JavaScript, you must use the OBJECT or XML option. If you are simply going to display these to the user, you can use the TEXT option.
- XML
- HTML
- SGML
- SOAP
- any other XML-compliant language
E4X
Since version 2.0.2 CPAINT also supports another XML-based format: E4X
E4X is a new JavaScript standard that is currently supported by Firefox 1.5 only. This makes it quite impractical for most scenarios but we believe E4X has so much potential that we decided to implement it, to express our support.
Read more about E4X on the ECMA Website.
JSON
Alongside E4X CPAINT supports JSON responses since version 2.0.2
This means that the backend developer may return any datatype including (value)objects to the frontend.
Other Formats
Theoretically, JavaScript should be able to handle these and other data formats, but only text formats have been tested, and binary formats may not work consistently across the different browser/JavaScript implementations, and may require 3rd party libraries/objects to manipulate and/or display.
The backend code, regardless of which language, should be able to handle the raw binary data from various formats, but you may need to use 3rd party libraries/objects to manipulate, read, or create these formats.
Note: This is not a complete list.
- Plain text
- JSON (JavaScript Object Notation)
- PON (PHP Object Notation)
- JavaScript or VBScript strings/code blocks
- Images (GIF, JPEG, and PNG)
- Adobe PDF Format
- Microsoft Office Formats (Word DOC, Access MDB, Excel XLS, PowerPoint PPT, and others)
- Executable code (EXEs (ActiveX, MFC, VB, .NET Assemblies), DLLs (ActiveX, MFC, .NET Assemblies))