-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,45 @@ | ||
|
||
Online demo at http://syssgx.github.com/xml.js/ | ||
|
||
This package exports the `xmllint` object which is an Emscripten port of | ||
libxml2's `xmllint` command for use in the browser or node. | ||
|
||
##### API ##### | ||
|
||
```javascript | ||
|
||
Object xmllint.validateXML({ | ||
xml: "String", | ||
schema: "String" || ["String", "String", ...] | ||
}); | ||
|
||
``` | ||
|
||
The return value Object has one property `errors` which is either null, | ||
in the case of no errors, or an Array of error strings....eg: | ||
|
||
```javascript | ||
|
||
if (!xmllint.validateXML(opts).errors) { | ||
//there were no errors. | ||
} | ||
|
||
``` | ||
|
||
Usable with Browserify via `browserify-shim`. | ||
|
||
#### Building xmllint from source #### | ||
|
||
Install emscripten. | ||
|
||
``` | ||
git clone | ||
git submodule init | ||
git submodule update | ||
./script/clean | ||
./script/libxml2 | ||
./script/compile | ||
./script/test | ||
``` | ||
|
||
There are also equivalent `gulp` tasks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters