-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
103 lines (102 loc) · 3.73 KB
/
Copy pathindex.html
File metadata and controls
103 lines (102 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>xml4js - JavaScript XML Writer Library</title>
<!-- Load Inks' Files -->
<link rel="stylesheet" type="text/css" href="http://cdn.ink.sapo.pt/2.1.1/css/ink-min.css">
<!--[if lt IE 9]>
<script type="text/javascript" src="http://cdn.ink.sapo.pt/2.1.1/js/html5shiv.js"></script>
<script type="text/javascript" src="http://cdn.ink.sapo.pt/2.1.1/js/html5shiv-printshiv.js"></script>
<![endif]-->
<!--[if lte IE 7 ]>
< link rel="stylesheet" href="http://cdn.ink.sapo.pt/2.1.1/css/ink-ie7.css" type="text/css" media="screen" title="no title" charset="utf-8">
<![endif]-->
<script type="text/javascript" src="http://cdn.ink.sapo.pt/2.1.1/js/ink.min.js"></script>
<!-- End of Inks' Files -->
<!-- Start xml4js files/scripts-->
<script type="text/javascript" src="xml4js.js"></script>
<script>
function exec() {
var code = document.getElementById("code").value;
eval(code);
document.getElementById("show").innerHTML = doc;
}
</script>
<!-- End of xml4js files/scripts-->
<style type="text/css">
h1 {
margin-top: 26px;
}
#code, #show {
padding: 4px;
width: 100%;
height: 550px;
}
#note {
font-size: 80%;
}
footer {
padding: 12px 10px;
font-size: 85%;
}
</style>
</head>
<body>
<div id="main" class="ink-grid">
<h1><i class="icon-code"></i> xml4js</h1>
<h4>JavaScript XML Writer Library</h4>
<p>The aim of the project is to create a lightweight library that enables the user to create XML documents with a low level complexity.</p>
<div class="column-group gutters">
<div id="left" class="large-50">
<textarea id="code">
var xml = new xml4js({encoding: "ISO-8859-1"});
xml.write("bookstore", function() {
xml.write("book");
xml.write("book", {category: "thriller"});
xml.write("book", "someValue");
xml.write("book", {category: "cooking"}, function() {
xml.write("title", {lang: "en"}, "Every Italian");
xml.write("author", "Giada de Laurentilis");
xml.write("year", "2005");
});
xml.write("book", {category: "children"}, function() {
xml.write("title", {lang: "en"}, "Harry Potter");
xml.write("author", "J. K. Rowling");
xml.write("year", "2005");
});
xml.write("book", function() {
xml.write("title", "Fear");
xml.write("author", "Jeff Abbott");
xml.write("year", "2006");
});
xml.write("data", {elem: "cdata"}, function() {
xml.write("cdata", "getAllBooks()");
});
});
var doc = xml.toString();
console.log(doc);
</textarea>
</div>
<div id="right" class="large-50">
<textarea id="show" readOnly="true"></textarea>
</div>
</div>
<div class="column-group">
<div class="large-100 push-center content-center">
<p id="note"><b>NOTE: </b>If you execute the demo you can see sample of XML document on you browser console.</p>
<br/>
</div>
</div>
<div class="column-group">
<div class="large-50 push-center content-center">
<button class="ink-button green large" onclick="exec();">Demo</button>
</div>
</div>
<footer>
<p>Copyright © 2013</p>
<p>Developed by <a href="http://about.me/pnascimento">Paulo Oliveira</a></p>
</footer>
</div>
</body>
</html>