You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Readme.md
+9
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ It can perform:
9
9
- Validity against DTD/XSD(Schema) check,
10
10
- Get doctype informations (about dtd)
11
11
- GetXpath Values
12
+
- Load XMl from string or file path
12
13
13
14
## Requirements:
14
15
@@ -23,6 +24,7 @@ Node-libxml has been thought differently than [libxmljs](https://github.com/libx
23
24
- You wan to validate against DTD (libxmljs can't)
24
25
- You want a silent program if xml is not wellformed (node-libxml returns wellformed error in object; libxmljs throws)
25
26
- You want to do xml processing in parallel forks
27
+
- You want to load XML from file path OR string
26
28
- You want to validate against DTD / schema on multiple documents with just ONE dtd/schema loaded in memory (libxmljs loads it on each validation request), so it's clearly by far fastest!
27
29
28
30
@@ -40,6 +42,8 @@ Node-libxml has been thought differently than [libxmljs](https://github.com/libx
40
42
let libxml =newLibxml();
41
43
42
44
let xmlIsWellformed =libxml.loadXml('path/to/xml');
45
+
let xmlIsWellformedStr =libxml.loadXmlFromString('<name>test</name>');
46
+
43
47
console.log(xmlIsWellformed);
44
48
console.log(xmlIsWellformed.wellformedErrors);
45
49
@@ -72,6 +76,11 @@ A function of libxml to load the XML file
72
76
`TAKE a path & RETURN true if wellformed | false if not`
73
77
`SET a an array 'wellformedErrors' in libxml element containing wellformed errors`
74
78
79
+
##### loadXmlFromString(string)
80
+
A function of libxml to create the xml Dom from a string
81
+
`TAKE a string containing xml & RETURN true if wellformed | false if not`
82
+
`SET a an array 'wellformedErrors' in libxml element containing wellformed errors`
0 commit comments