Skip to content

Commit 99b98ea

Browse files
Generating three constructors for encryptionDataElement.newKeyDerivationElement(..) only for ODF 1.3!
1 parent f59e10a commit 99b98ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

generator/schema2template/src/test/resources/test-input/odf/generation/odfdom-java/pkg/template/pkg-manifest-element-template.vm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ public class $className extends $baseClassName {
221221
## ---------------------------------------------------
222222
##
223223
#foreach($ch in $children)
224-
#if ($ch == "manifest:key-derivation")
224+
## There should be three constructors generated for <manifest:key-derivation>
225+
## As there are three possible values for @manifest:key-derivation-name - twice strings or URI!
226+
## see https://docs.oasis-open.org/office/OpenDocument/v1.3/os/schemas/OpenDocument-v1.3-manifest-schema-rng.html#key-derivation-attlist
227+
#if ($ch == "manifest:key-derivation" && "1.3" == ${xmlModel.getGrammarVersion()})
225228
/**
226229
* Create child element {@odf.element manifest:key-derivation}.
227230
*
@@ -276,7 +279,8 @@ public class $className extends $baseClassName {
276279
}
277280

278281
#end
279-
#if ($ch != "*" && $ch != "manifest:key-derivation")
282+
## Do not create the any attribute and neither create the already added constructors of <manifest:key-derivation>
283+
#if ($ch != "*" && !($ch == "manifest:key-derivation" && "1.3" == ${xmlModel.getGrammarVersion()}))
280284
#set ($child = ${ch.withMultiples()})
281285
#set ($cClassName = "${xmlModel.camelCase(${child.getLocalName()})}Element")
282286
#set ($cVar = ${xmlModel.javaCase(${child.getLocalName()})})

0 commit comments

Comments
 (0)