diff --git a/dom/m_dom_configuration.m4 b/dom/m_dom_configuration.m4 index b2b87425..2bdc542d 100644 --- a/dom/m_dom_configuration.m4 +++ b/dom/m_dom_configuration.m4 @@ -20,7 +20,7 @@ TOHW_m_dom_publics(` integer, parameter :: configParamLen = 42 - character(len=configParamLen), parameter :: configParams(23) = (/ & + character(len=configParamLen), parameter :: configParams(24) = (/ & ! DOM 3 Core: "canonical-form ", & "cdata-sections ", & @@ -49,57 +49,12 @@ TOHW_m_dom_publics(` ! DOM 3 LS (Serializer) "discard-default-content ", & "format-pretty-print ", & - "xml-declaration " /) - -!!$ logical, parameter :: paramSettable(26) = (/ & -!!$ .true., & ! canonical-form -!!$ .true., & ! cdata-sections -!!$ .false., & ! check-character-normalization -!!$ .true., & ! comments -!!$ .false., & ! datatype-normalization -!!$ .true., & ! element-content-whitespace -!!$ .true., & ! entities -!!$ .false., & ! error-handler BREACH OF SPEC -!!$ !.false., & ! infoset -!!$ .true., & ! namespaces -!!$ .true., & ! namespace-declarations -!!$ .false., & ! normalize-characters -!!$ .true., & ! split-cdata-sections -!!$ .false., & ! well-formed -!!$ .false., & ! charset-overrides-xml-encoding -!!$ .false., & ! disallow-doctype -!!$ .false., & ! ignore-unknown-character-denormalizations -!!$ .false., & ! resource-resolver BREACH OF SPEC -!!$ .false., & ! supported-media-types-only -!!$ .true., & ! discard-default-content -!!$ .false., & ! format-pretty-print -!!$ .true. /) ! xml-declaration - integer, parameter :: paramSettable = 127956694 - -!!$ logical, parameter :: paramDefaults(26) = (/ & -!!$ .false., & ! canonical-form -!!$ .true., & ! cdata-sections -!!$ .false., & ! check-character-normalization -!!$ .true., & ! comments -!!$ .false., & ! datatype-normalization -!!$ .true., & ! element-content-whitespace -!!$ .true., & ! entities -!!$ .false., & ! error-handler BREACH OF SPEC -!!$ !.true., & ! infoset -!!$ .true., & ! namespaces -!!$ .true., & ! namespace-declarations -!!$ .false., & ! normalize-characters -!!$ .true., & ! split-cdata-sections -!!$ .true., & ! well-formed -!!$ .false., & ! charset-overrides-xml-encoding -!!$ .false., & ! disallow-doctype -!!$ .true., & ! ignore-unknown-character-denormalizations -!!$ .false., & ! resource-resolver BREACH OF SPEC -!!$ .false., & ! supported-media-types-only -!!$ .true., & ! discard-default-content -!!$ .false., & ! format-pretty-print -!!$ .true. /) ! xml-declaration - integer, parameter :: paramDefaults = 94672596 + "xml-declaration ", & + ! Extra (FoX) configuration options + "invalid-pretty-print " /) + + integer, parameter :: paramSettable = 27293398 + integer, parameter :: paramDefaults = 10786516 type DOMConfiguration private @@ -198,6 +153,7 @@ TOHW_m_dom_contents(` ! call setParameter(domConfig, "format-pretty-print", .false.) domConfig%parameters = ibclr(domConfig%parameters, 21) domConfig%parameters = ibclr(domConfig%parameters, 23) + domConfig%parameters = ibclr(domConfig%parameters, 24) else call resetParameter(domConfig, "entities") ! cant do normalize-characters @@ -209,6 +165,7 @@ TOHW_m_dom_contents(` call resetParameter(domConfig, "format-pretty-print") call resetParameter(domConfig, "discard-default-content") call resetParameter(domConfig, "xml-declaration") + call resetParameter(domConfig, "invalid-pretty-print") endif case ("cdata-sections") if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) @@ -230,6 +187,8 @@ TOHW_m_dom_contents(` if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) case ("xml-declaration") if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) + case ("invalid-pretty-print") + if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) end select end subroutine setParameter diff --git a/dom/m_dom_dom.F90 b/dom/m_dom_dom.F90 index 246e6cc1..6725f524 100644 --- a/dom/m_dom_dom.F90 +++ b/dom/m_dom_dom.F90 @@ -33,7 +33,7 @@ module m_dom_dom integer, parameter :: configParamLen = 42 - character(len=configParamLen), parameter :: configParams(23) = (/ & + character(len=configParamLen), parameter :: configParams(24) = (/ & ! DOM 3 Core: "canonical-form ", & "cdata-sections ", & @@ -62,57 +62,12 @@ module m_dom_dom ! DOM 3 LS (Serializer) "discard-default-content ", & "format-pretty-print ", & - "xml-declaration " /) - -!!$ logical, parameter :: paramSettable(26) = (/ & -!!$ .true., & ! canonical-form -!!$ .true., & ! cdata-sections -!!$ .false., & ! check-character-normalization -!!$ .true., & ! comments -!!$ .false., & ! datatype-normalization -!!$ .true., & ! element-content-whitespace -!!$ .true., & ! entities -!!$ .false., & ! error-handler BREACH OF SPEC -!!$ !.false., & ! infoset -!!$ .true., & ! namespaces -!!$ .true., & ! namespace-declarations -!!$ .false., & ! normalize-characters -!!$ .true., & ! split-cdata-sections -!!$ .false., & ! well-formed -!!$ .false., & ! charset-overrides-xml-encoding -!!$ .false., & ! disallow-doctype -!!$ .false., & ! ignore-unknown-character-denormalizations -!!$ .false., & ! resource-resolver BREACH OF SPEC -!!$ .false., & ! supported-media-types-only -!!$ .true., & ! discard-default-content -!!$ .false., & ! format-pretty-print -!!$ .true. /) ! xml-declaration - integer, parameter :: paramSettable = 127956694 - -!!$ logical, parameter :: paramDefaults(26) = (/ & -!!$ .false., & ! canonical-form -!!$ .true., & ! cdata-sections -!!$ .false., & ! check-character-normalization -!!$ .true., & ! comments -!!$ .false., & ! datatype-normalization -!!$ .true., & ! element-content-whitespace -!!$ .true., & ! entities -!!$ .false., & ! error-handler BREACH OF SPEC -!!$ !.true., & ! infoset -!!$ .true., & ! namespaces -!!$ .true., & ! namespace-declarations -!!$ .false., & ! normalize-characters -!!$ .true., & ! split-cdata-sections -!!$ .true., & ! well-formed -!!$ .false., & ! charset-overrides-xml-encoding -!!$ .false., & ! disallow-doctype -!!$ .true., & ! ignore-unknown-character-denormalizations -!!$ .false., & ! resource-resolver BREACH OF SPEC -!!$ .false., & ! supported-media-types-only -!!$ .true., & ! discard-default-content -!!$ .false., & ! format-pretty-print -!!$ .true. /) ! xml-declaration - integer, parameter :: paramDefaults = 94672596 + "xml-declaration ", & + ! Extra (FoX) configuration options + "invalid-pretty-print " /) + + integer, parameter :: paramSettable = 27293398 + integer, parameter :: paramDefaults = 10786516 type DOMConfiguration private @@ -616,6 +571,7 @@ recursive subroutine setParameter(domConfig, name, value, ex) ! call setParameter(domConfig, "format-pretty-print", .false.) domConfig%parameters = ibclr(domConfig%parameters, 21) domConfig%parameters = ibclr(domConfig%parameters, 23) + domConfig%parameters = ibclr(domConfig%parameters, 24) else call resetParameter(domConfig, "entities") ! cant do normalize-characters @@ -627,6 +583,7 @@ recursive subroutine setParameter(domConfig, name, value, ex) call resetParameter(domConfig, "format-pretty-print") call resetParameter(domConfig, "discard-default-content") call resetParameter(domConfig, "xml-declaration") + call resetParameter(domConfig, "invalid-pretty-print") endif case ("cdata-sections") if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) @@ -648,6 +605,8 @@ recursive subroutine setParameter(domConfig, name, value, ex) if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) case ("xml-declaration") if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) + case ("invalid-pretty-print") + if (value) domConfig%parameters = ibclr(domConfig%parameters, 1) end select end subroutine setParameter diff --git a/dom/m_dom_utils.f90 b/dom/m_dom_utils.f90 index dd93acd6..f0e443f2 100644 --- a/dom/m_dom_utils.f90 +++ b/dom/m_dom_utils.f90 @@ -178,8 +178,15 @@ subroutine serialize(startNode, name, ex) ! (except for namespace Normalization) but rather just ! pay attention to the DOMConfig values + ! NOTE: We set pretty_print on the basis of the FoX specific + ! "invalid-pretty-print" config option. The DOM-L3-LS + ! option "format-pretty-print is always false and is + ! not settable by the user - this is because WXML + ! cannot preserve validity conditions that may be set + ! by a DTD. If WXML ever learns to do this we will need + ! to pass the value of "format-pretty-print" through. call xml_OpenFile(name, xf, iostat=iostat, unit=-1, & - pretty_print=getParameter(getDomConfig(doc), "format-pretty-print"), & + pretty_print=getParameter(getDomConfig(doc), "invalid-pretty-print"), & canonical=getParameter(getDomConfig(doc), "canonical-form"), & warning=.false., addDecl=.false.) if (iostat/=0) then diff --git a/dom/m_dom_utils.m4 b/dom/m_dom_utils.m4 index c0eef1eb..0a6800af 100644 --- a/dom/m_dom_utils.m4 +++ b/dom/m_dom_utils.m4 @@ -150,8 +150,15 @@ contains ! (except for namespace Normalization) but rather just ! pay attention to the DOMConfig values + ! NOTE: We set pretty_print on the basis of the FoX specific + ! "invalid-pretty-print" config option. The DOM-L3-LS + ! option "format-pretty-print is always false and is + ! not settable by the user - this is because WXML + ! cannot preserve validity conditions that may be set + ! by a DTD. If WXML ever learns to do this we will need + ! to pass the value of "format-pretty-print" through. call xml_OpenFile(name, xf, iostat=iostat, unit=-1, & - pretty_print=getParameter(getDomConfig(doc), "format-pretty-print"), & + pretty_print=getParameter(getDomConfig(doc), "invalid-pretty-print"), & canonical=getParameter(getDomConfig(doc), "canonical-form"), & warning=.false., addDecl=.false.) if (iostat/=0) then