-
Notifications
You must be signed in to change notification settings - Fork 47
/
xml-escape-unescape.html
199 lines (189 loc) · 9.36 KB
/
xml-escape-unescape.html
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
---
title: XML Escape | UnEscape Online | Developer Tools
layout: post
---
<html>
<head>
{% include common-meta %}
<title>{{ page.title }}</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="description" content="This is open source tool for programmers to escape or unescape a String value for HTML use." />
<meta name="keywords" content="online,tool,html,escape,unescape,encode,decode,web,opensource,http" /> {% include theme-css %} {% include ie-fixes %}
</head>
<body class="hold-transition skin-green sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
{% include theme-header %} {% include theme-sidebar %}
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="box box-info">
<div class="box-header with-border">
<h1 class="box-title">XML Escape and UnEscape</h1>
</div>
<!-- /.box-header -->
<!-- form start -->
<div class="box-body">
<form role="form">
<div class="form-group">
<textarea class="form-control" rows="20" placeholder="Copy/Paste text here to escape or unescape" id="inputText" autofocus></textarea>
</div>
</form>
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="btn-group">
<button type="button" class="btn btn-success" id="escape"> Escape </button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-info" id="unescape">UnEscape</button>
</div>
</div>
<!-- /.box-footer -->
</div>
</section>
<section class="content">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">About XML Escape and UnEscape Tool</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>This is a free online tool to escape and unescape XML markup. You can copy/paste your desired XML in below text field and hit Escape or UnEscape button.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What is XML Escaping?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>HTML escaping is used to represent special meaning characters in a XML code. e.g. less than symbol <code><</code> has a special meaning in XML markup language. But in case your data contains a less than symbol <code><</code> and you want to send it without confusing the browser then you need to send it as &lt; instead of <code><</code> . Simlarly there are many other special characters that can be used as part of XML markup. Below sample
list can give you a idea of what this means.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header">
<h3 class="box-title">XML Escaping Characters</h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tbody>
<tr>
<th>Character</th>
<th>XML Escape Value</th>
</tr>
<tr>
<td>quote (")</td>
<td>&quot;</td>
</tr>
<tr>
<td>amphersand (&)</td>
<td>&amp;</td>
</tr>
<tr>
<td>less than symbol (<)</td>
<td>&lt;</td>
</tr>
<tr>
<td>greater than symbol (>)</td>
<td>&gt;</td>
</tr>
<tr>
<td>single quote (')</td>
<td>&apos;</td>
</tr>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Want To Know What Is The XML Escaped Value of a Character?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>That is easy. Just type the character or a full string in the text box above and hit Escape button. You should be able to see the escaped value.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What is HTML UnEscaping?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>XML UnEscaping is the reverse process of escaping. This is used by the browser and client side programming languages to get the real data value from escaped string.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What Characters Need To Be Escaped?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>Only few special meaning character need to be escaped. These characters have special use in XML markup language. </p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Explore More on XML Conversion</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>While escaping and unescaping XML characters are essential tasks when working with XML data, you may also encounter the need for more complex XML conversions. Whether you're converting XML to CSV, JSON, any other format or to database, you can check this <a href="https://sonra.io/xml-converters-and-conversion-guide/" target="_blank">XML Converters and Conversion Guide</a> which provides a comprehensive overview of the best tools and techniques to streamline the process.</p>
</div>
<!-- /.box-body -->
</div>
</section>
{% include addthis %}
</div>
<!-- /.content-wrapper -->
{% include theme-footer %}
</div>
<!-- ./wrapper -->
{% include theme-bottom-js %}
</body>
<script src="plugins/selectOnFocus/jquery.selectOnFocus.min.js"></script>
<script>
if (!String.prototype.encodeHTML) {
String.prototype.encodeHTML = function() {
return this.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
};
}
if (!String.prototype.decodeHTML) {
String.prototype.decodeHTML = function() {
return this.replace(/'/g, "'")
.replace(/"/g, '"')
.replace(/>/g, '>')
.replace(/</g, '<')
.replace(/&/g, '&');
};
}
$(document).ready(function() {
$("#escape").click(function() {
var inputTextArea = $("#inputText");
inputTextArea.val(inputTextArea.val().encodeHTML());
});
$("#unescape").click(function() {
var inputTextArea = $("#inputText");
inputTextArea.val(inputTextArea.val().decodeHTML());
});
$("#inputText").selectOnFocus();
$('#string-utility-category').addClass('active');
});
</script>
</html>