@@ -174,6 +174,13 @@ declare variable $ser:xi-doc := document {
174
174
</article>
175
175
};
176
176
177
+ declare variable $ser:in-memory-book :=
178
+ <book>
179
+ <author>John Doe</author>
180
+ <author>Robert Smith</author>
181
+ </book>
182
+ ;
183
+
177
184
declare
178
185
%test:setUp
179
186
function ser:setup () {
@@ -665,126 +672,117 @@ function ser:adaptive-xs-strings-map-params() {
665
672
};
666
673
667
674
declare
675
+ %test:args("true" )
668
676
%test:assertXPath("contains($result, '-//OASIS//DTD DITA BookMap//EN') and contains($result, 'bookmap.dtd')" )
669
- function ser:exist-output-doctype-true () {
677
+ %test:args("false" )
678
+ %test:assertXPath("not(contains($result, '-//OASIS//DTD DITA BookMap//EN')) and not(contains($result, 'bookmap.dtd'))" )
679
+ function ser:exist-output-doctype-QName ($value as xs:boolean) {
670
680
serialize (doc ($ser:collection || "/test-with-doctype.xml" ),
671
- map { "exist:output-doctype" : true () })
681
+ map { xs:QName ( "exist:output-doctype" ) : $value })
672
682
};
673
683
674
684
declare
685
+ %test:args("true" )
675
686
%test:assertXPath("contains($result, '-//OASIS//DTD DITA BookMap//EN') and contains($result, 'bookmap.dtd')" )
676
- function ser:exist-output-doctype-true-QName () {
677
- serialize (doc ($ser:collection || "/test-with-doctype.xml" ),
678
- map { xs:QName ("exist:output-doctype" ): true () })
679
- };
680
-
681
- declare
687
+ %test:args("false" )
682
688
%test:assertXPath("not(contains($result, '-//OASIS//DTD DITA BookMap//EN')) and not(contains($result, 'bookmap.dtd'))" )
683
- function ser:exist-output-doctype-false ( ) {
689
+ function ser:exist-output-doctype-string ($value as xs:boolean ) {
684
690
serialize (doc ($ser:collection || "/test-with-doctype.xml" ),
685
- map { "exist:output-doctype" : false () })
686
- };
687
-
688
- declare
689
- %test:assertXPath("contains($result, 'include')" )
690
- function ser:exist-expand-xinclude-false () {
691
- serialize ($ser:xi-doc,
692
- map { "exist:expand-xincludes" : false () })
691
+ map { "exist:output-doctype" : $value })
693
692
};
694
693
695
694
declare
695
+ %test:args("true" )
696
696
%test:assertXPath("contains($result, 'comment')" )
697
- function ser:exist-expand-xinclude-true () {
697
+ %test:args("false" )
698
+ %test:assertXPath("contains($result, 'include')" )
699
+ function ser:exist-expand-xinclude-QName ($value as xs:boolean) {
698
700
serialize ($ser:xi-doc,
699
- map { "exist:expand-xincludes" : true () })
701
+ map { xs:QName ( "exist:expand-xincludes" ): $value })
700
702
};
701
703
702
704
declare
705
+ %test:args("true" )
703
706
%test:assertXPath("contains($result, 'comment')" )
704
- function ser:exist-expand-xinclude-true-QName () {
707
+ %test:args("false" )
708
+ %test:assertXPath("contains($result, 'include')" )
709
+ function ser:exist-expand-xinclude-string ($value as xs:boolean) {
705
710
serialize ($ser:xi-doc,
706
- map { xs:QName ( "exist:expand-xincludes" ): true () })
711
+ map { "exist:expand-xincludes" : $value })
707
712
};
708
713
709
714
declare
715
+ %test:args("all" )
710
716
%test:assertEquals('<?pi?><elem xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:id="2" exist:source="test.xml" a="abc"><!--comment--><b exist:id="2.3">123</b></elem>' )
711
- function ser:exist-add-exist-id-all () {
717
+ %test:args("element" )
718
+ %test:assertEquals('<?pi?><elem xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:id="2" exist:source="test.xml" a="abc"><!--comment--><b>123</b></elem>' )
719
+ %test:args("none" )
720
+ %test:assertXPath("not(contains($result, 'exist:id'))" )
721
+ function ser:exist-add-exist-id-QName ($value as xs:string) {
712
722
serialize (doc ($ser:collection || "/test.xml" ),
713
- map { "exist:add-exist-id" : "all" })
723
+ map { xs:QName ( "exist:add-exist-id" ): $value })
714
724
};
715
725
716
726
declare
727
+ %test:args("all" )
717
728
%test:assertEquals('<?pi?><elem xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:id="2" exist:source="test.xml" a="abc"><!--comment--><b exist:id="2.3">123</b></elem>' )
718
- function ser:exist-add-exist-id-all-QName () {
719
- serialize (doc ($ser:collection || "/test.xml" ),
720
- map { xs:QName ("exist:add-exist-id" ): "all" })
721
- };
722
-
723
- declare
729
+ %test:args("element" )
724
730
%test:assertEquals('<?pi?><elem xmlns:exist="http://exist.sourceforge.net/NS/exist" exist:id="2" exist:source="test.xml" a="abc"><!--comment--><b>123</b></elem>' )
725
- function ser:exist-add-exist-id-element () {
726
- serialize (doc ($ser:collection || "/test.xml" ),
727
- map { "exist:add-exist-id" : "element" })
728
- };
729
-
730
- declare
731
- %test:assertXPath("not(contains($result, 'exist:id'))" )
732
- function ser:exist-add-exist-id-none () {
731
+ %test:args("none" )
732
+ %test:assertXPath("not(contains($result, 'exist:id'))" )
733
+ function ser:exist-add-exist-id-string ($value as xs:string) {
733
734
serialize (doc ($ser:collection || "/test.xml" ),
734
- map { "exist:add-exist-id" : "none" })
735
+ map { "exist:add-exist-id" : $value })
735
736
};
736
737
737
738
declare
739
+ %test:args("functionName" )
738
740
%test:assertEquals('functionName({"author":["John Doe","Robert Smith"]})' )
739
- function ser:exist-jsonp () {
740
- serialize (
741
- <book>
742
- <author>John Doe</author>
743
- <author>Robert Smith</author>
744
- </book>,
741
+ %test:args("anotherName" )
742
+ %test:assertEquals('anotherName({"author":["John Doe","Robert Smith"]})' )
743
+ function ser:exist-jsonp-QName ($value as xs:string) {
744
+ serialize ($ser:in-memory-book,
745
745
map {
746
746
"method" : "json" ,
747
747
"media-type" : "application/json" ,
748
- "exist:jsonp" : "functionName"
748
+ xs:QName ( "exist:jsonp" ): $value
749
749
}
750
750
)
751
751
};
752
752
753
753
declare
754
+ %test:args("functionName" )
754
755
%test:assertEquals('functionName({"author":["John Doe","Robert Smith"]})' )
755
- function ser:exist-jsonp-QName () {
756
- serialize (
757
- <book>
758
- <author>John Doe</author>
759
- <author>Robert Smith</author>
760
- </book>,
756
+ %test:args("anotherName" )
757
+ %test:assertEquals('anotherName({"author":["John Doe","Robert Smith"]})' )
758
+ function ser:exist-jsonp-string ($value as xs:string) {
759
+ serialize ($ser:in-memory-book,
761
760
map {
762
761
"method" : "json" ,
763
762
"media-type" : "application/json" ,
764
- xs:QName ( "exist:jsonp" ): "functionName"
763
+ "exist:jsonp" : $value
765
764
}
766
765
)
767
766
};
768
767
769
768
declare
769
+ %test:args("true" )
770
770
%test:assertEquals('processed' )
771
- function ser:exist-process-xsl-pi-true () {
771
+ %test:args("false" )
772
+ %test:assertXPath("contains($result, 'stylesheet')" )
773
+ function ser:exist-process-xsl-pi-QName ($value as xs:boolean) {
772
774
serialize (doc ($ser:collection || "/test-xsl.xml" ),
773
- map { "exist:process-xsl-pi" : true () })
775
+ map { xs:QName ( "exist:process-xsl-pi" ): $value })
774
776
};
775
777
776
778
declare
779
+ %test:args("true" )
777
780
%test:assertEquals('processed' )
778
- function ser:exist-process-xsl-pi-true-QName () {
779
- serialize (doc ($ser:collection || "/test-xsl.xml" ),
780
- map { xs:QName ("exist:process-xsl-pi" ): true () })
781
- };
782
-
783
- declare
781
+ %test:args("false" )
784
782
%test:assertXPath("contains($result, 'stylesheet')" )
785
- function ser:exist-process-xsl-pi-false ( ) {
783
+ function ser:exist-process-xsl-pi-string ($value as xs:boolean ) {
786
784
serialize (doc ($ser:collection || "/test-xsl.xml" ),
787
- map { "exist:process-xsl-pi" : false () })
785
+ map { "exist:process-xsl-pi" : $value })
788
786
};
789
787
790
788
declare
0 commit comments