summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkdubost <kdubost@localhost>2008-07-14 03:09:58 +0000
committerkdubost <kdubost@localhost>2008-07-14 03:09:58 +0000
commit62e73411f555abfed9ea72a36be18ef4f86b85e7 (patch)
treea4ca786223a8099f46983a899c2c21dd842ddd0e
parent0358265e38ec2a037244fdb690d1acc29edf88c4 (diff)
downloadmarkup-validator-62e73411f555abfed9ea72a36be18ef4f86b85e7.zip
markup-validator-62e73411f555abfed9ea72a36be18ef4f86b85e7.tar.gz
markup-validator-62e73411f555abfed9ea72a36be18ef4f86b85e7.tar.bz2
first attempt at a JSON output template
-rw-r--r--share/templates/en_US/json_ouput.tmpl30
1 files changed, 30 insertions, 0 deletions
diff --git a/share/templates/en_US/json_ouput.tmpl b/share/templates/en_US/json_ouput.tmpl
new file mode 100644
index 0000000..24fbe51
--- /dev/null
+++ b/share/templates/en_US/json_ouput.tmpl
@@ -0,0 +1,30 @@
+Content-Type: application/json; charset=UTF-8
+X-W3C-Validator-Recursion: <TMPL_VAR NAME="depth" DEFAULT="1"><TMPL_IF NAME="fatal_error">
+X-W3C-Validator-Status: Abort<TMPL_ELSE><TMPL_IF NAME="valid_status">
+X-W3C-Validator-Status: <TMPL_VAR NAME="valid_status"></TMPL_IF>
+X-W3C-Validator-Errors: <TMPL_VAR NAME="valid_errors_num">
+X-W3C-Validator-Warnings: <TMPL_VAR NAME="valid_warnings_num"></TMPL_IF>
+
+
+{
+ "url": "<TMPL_VAR NAME="file_uri">",
+ "messages": [
+ <TMPL_LOOP NAME="file_errors">
+ {
+ <TMPL_IF NAME="err_type_err">"type": "error",</TMPL_IF>
+ <TMPL_IF NAME="err_type_warn">"type": "warning",</TMPL_IF>
+ "lastLine": "<TMPL_VAR NAME="line">",
+ "firstColumn": "<TMPL_VAR NAME="char">",
+ "message": "<TMPL_VAR NAME="msg">",
+ "messageid": "<TMPL_VAR NAME="num">",
+ "explanation": "<TMPL_VAR NAME="expl">",
+ "extract":"<TMPL_VAR NAME="src">"
+ }
+ </TMPL_LOOP>
+
+ ],
+ "source": {
+ "encoding": "<TMPL_VAR NAME="file_charset">"
+ }
+}
+