@@ -132,6 +132,8 @@ declare variable $ser:test-xml := document {
132
132
<elem a = "abc" ><!--comment--> <b>123 </b></elem>
133
133
};
134
134
135
+ declare variable $ser:test-xml-with-doctype := '<!DOCTYPE bookmap PUBLIC "-//OASIS//DTD DITA BookMap//EN" "bookmap.dtd"><bookmap id="bookmap-1"/>' ;
136
+
135
137
declare variable $ser:collection-name := "serialization-test" ;
136
138
137
139
declare variable $ser:collection := "/db/" || $ser:collection-name;
@@ -142,7 +144,8 @@ function ser:setup() {
142
144
xmldb:create-collection ("/db" , $ser:collection-name),
143
145
xmldb:store ($ser:collection, "test.xml" , $ser:test-xml),
144
146
xmldb:store ($ser:collection, "test-xsl.xml" , $ser:test-xsl),
145
- xmldb:store ($ser:collection, "test.xsl" , $ser:xsl)
147
+ xmldb:store ($ser:collection, "test.xsl" , $ser:xsl),
148
+ xmldb:store ($ser:collection, "test-with-doctype.xml" , $ser:test-xml-with-doctype)
146
149
};
147
150
148
151
declare
@@ -701,6 +704,22 @@ function ser:adaptive-xs-strings-map-params() {
701
704
ser:adaptive-map-params ($input, "," )
702
705
};
703
706
707
+ declare
708
+ %test:assertXPath("contains($result, '-//OASIS//DTD DITA BookMap//EN') and contains($result, 'bookmap.dtd')" )
709
+ function ser:exist-output-doctype-true () {
710
+ let $doc := doc ($ser:collection || "/test-with-doctype.xml" )
711
+ return
712
+ fn:serialize ($doc, map { xs:QName ("exist:output-doctype" ): fn:true () })
713
+ };
714
+
715
+ declare
716
+ %test:assertXPath("not(contains($result, '-//OASIS//DTD DITA BookMap//EN')) and not(contains($result, 'bookmap.dtd'))" )
717
+ function ser:exist-output-doctype-false () {
718
+ let $doc := doc ($ser:collection || "/test-with-doctype.xml" )
719
+ return
720
+ fn:serialize ($doc, map { xs:QName ("exist:output-doctype" ): fn:false () })
721
+ };
722
+
704
723
declare
705
724
%test:assertXPath("contains($result, 'include')" )
706
725
function ser:exist-expand-xinclude-false () {
0 commit comments