From: "Caldarale, Charles R" <[email protected]>
To: Tomcat Users List <[email protected]>; Dave Glasser
<[email protected]>
Sent: Tuesday, April 26, 2016 2:32 PM
Subject: RE: Order of attributes significant in zipfileset?
>> From: Dave Glasser [mailto:[email protected]]
>> Subject: Order of attributes significant in zipfileset?
>
>> If you have a <zipfileset> element with both a dir and a file attribute, it
>> will produce
>> different results depending on the order in which those attributes appear.
>
>Not surprising.
Really? Not surprising at all? I've never encountered a piece of software where
the order of attributes on an input XML document mattered. AFAICT, you can't
enforce the order of attribute names through a DTD or schema. Even W3C says
"Notethat the order of attribute specifications in a start-tag or
empty-elementtag is not significant." So, to me, it's quite surprising to
encounter a situation where the order of attributes makes such a dramatic (but
non-obvious) difference.
>> I want to make clear that I'm aware that the docs for fileset say:
>> "Either dir or file must be specified" and that I might be doing it wrong.
>> You could argue
>> otherwise, but perhaps that does in fact unambiguously imply that having
>> both is incorrect
>> and hence the behavior is undefined.
>
>
>Yes, it's undefined. The file attribute is documented as a "shortcut for
>specifying a single-file fileset" - you should not use both dir and file. If
>you want a single file in a particular directory, use just the file attribute:
>
><zipfileset file="dir1/file1.txt"/>
Yep, that's pretty much what I figured. Or just use the includes attribute
instead of file. That seems to work the way you'd expect it to, and the
documentation is clear and unambiguous. I was just hoping maybe someone had
some deeper information on this beyond an interpretation of the documents.