@@ -179,7 +179,9 @@ CDATA can be emitted:
179179 (xml/emit-str (xml/element :foo {}
180180 (xml/cdata "<non><escaped><info><here>")))
181181
182- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo><![CDATA[<non><escaped><info><here>]]></foo>"
182+ ;; newlines added for readability, not in actual output
183+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
184+ <foo><![CDATA[<non><escaped><info><here>]]></foo>"
183185
184186But will be read as regular character data:
185187
@@ -195,7 +197,9 @@ Comments can also be emitted:
195197 (xml/xml-comment "Just a <comment> goes here")
196198 (xml/element :bar {} "and another element")))
197199
198- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo><!--Just a <comment> goes here--><bar>and another element</bar></foo>"
200+ ;; newlines added for readability, not in actual output
201+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
202+ <foo><!--Just a <comment> goes here--><bar>and another element</bar></foo>"
199203
200204But are ignored when read:
201205
@@ -205,7 +209,9 @@ But are ignored when read:
205209 (xml/xml-comment "Just a <comment> goes here")
206210 (xml/element :bar {} "and another element")))))
207211
208- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo><bar>and another element</bar></foo>"
212+ ;; newlines added for readability, not in actual output
213+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
214+ <foo><bar>and another element</bar></foo>"
209215
210216## Namespace Support
211217
@@ -236,7 +242,9 @@ It is also allowable to use `javax.xml.namespace.QName` instances, as well as st
236242 (xml/emit-str {:tag (xml/qname "http://www.w3.org/1999/xhtml" "html")})
237243 (xml/emit-str {:tag "{http://www.w3.org/1999/xhtml}html"})
238244
239- <?xml version=\"1.0\" encoding=\"UTF-8\"?><a:html xmlns:a=\"http://www.w3.org/1999/xhtml\"></a:html>
245+ ;; newlines added for readability, not in actual output
246+ <?xml version=\"1.0\" encoding=\"UTF-8\"?>
247+ <a:html xmlns:a=\"http://www.w3.org/1999/xhtml\"></a:html>
240248
241249### Namespace Prefixes
242250
@@ -248,7 +256,10 @@ kw-namespace:
248256 (xml/element (xml/qname "http://www.w3.org/1999/xhtml" "title")
249257 {:xmlns/foo "http://www.w3.org/1999/xhtml"}
250258 "Example title"))
251- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><foo:title xmlns:foo=\"http://www.w3.org/1999/xhtml\">Example title</foo:title>"
259+
260+ ;; newlines added for readability, not in actual output
261+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
262+ <foo:title xmlns:foo=\"http://www.w3.org/1999/xhtml\">Example title</foo:title>"
252263
253264Not specifying a namespace prefix will results in a prefix being generated:
254265
@@ -257,7 +268,9 @@ Not specifying a namespace prefix will results in a prefix being generated:
257268 {}
258269 "Example title"))
259270
260- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:title xmlns:a=\"http://www.w3.org/1999/xhtml\">Example title</a:title>"
271+ ;; newlines added for readability, not in actual output
272+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
273+ <a:title xmlns:a=\"http://www.w3.org/1999/xhtml\">Example title</a:title>"
261274
262275The above example auto assigns prefixes for the namespaces used. In
263276this case it was named ` a ` by the emitter. Emitting several nested
@@ -272,7 +285,11 @@ tags with the same namespace will use one prefix:
272285 {}
273286 "Example title"))))
274287
275- "<?xml version=\"1.0\" encoding=\"UTF-8\"?><a:html xmlns:a=\"http://www.w3.org/1999/xhtml\"><a:head><a:title>Example title</a:title></a:head></a:html>"
288+ ;; newlines and indents added for readability, not in actual output
289+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
290+ <a:html xmlns:a=\"http://www.w3.org/1999/xhtml\">
291+ <a:head>
292+ <a:title>Example title</a:title></a:head></a:html>"
276293
277294Note that the jdk QName ignores namespace prefixes for equality, but allows to preserve them for emitting.
278295
0 commit comments