Originally posted by: SystemAdmin
Yes, your method would work. I could also model the economy of the world from a WTX map if I call the right external program. It is trivial to extract zip files in a script. My point is that I didn't find an easy way to do it from within a map. Not saying it can't be done. I just didn't find any method.
I just wanted the file names from the zip file so the type tree is rather simple with ugly record terminators. They're actually initiators in the zipfile but I found it necessary to define them as terminators in the Type Designer.
Here it is:
code<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TTMAKER SYSTEM "ttmaker60.dtd">
<?ANALYZE?><TTMAKER Version="6.0"><NEWTREE Filename="C:\MercatorTips\ZipMapFiles\ZipFile.mtt"><ROOT SimpleTypeName="ZipFile" SetUpProperties="DEFAULT" SetUpComponents="DELETE" OrderSubtypes="ASCENDING"><Sequence partition="NO"><Implicit/></Sequence>
<CharTextWestern><Size Min="0" Max="S"/>
<Western CharSet="NATIVE"/>
<ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
</CharTextWestern>
</ROOT>
<ITEM SimpleTypeName="Blob" CategoryOrItemParent="ZipFile" partition="NO" OrderSubtypes="ASCENDING"><TypeSyntax><TERMINATOR><Literal IgnoreCase="NO"><Western CharSet="NATIVE"/>
<LiteralValue><<50>><<4B>><<01>><<02>><<14>></LiteralValue>
</Literal>
</TERMINATOR>
</TypeSyntax>
<CharTextWestern><Size Min="0" Max="S"/>
<Western CharSet="NATIVE"/>
<ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
</CharTextWestern>
</ITEM>
<ITEM SimpleTypeName="BlobTrailer" CategoryOrItemParent="ZipFile" partition="NO" OrderSubtypes="ASCENDING"><CharTextWestern><Size Min="0" Max="S"/>
<Western CharSet="NATIVE"/>
<ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
</CharTextWestern>
</ITEM>
<GROUP SimpleTypeName="File" CategoryOrGroupParent="ZipFile" OrderSubtypes="ASCENDING"><Sequence partition="NO"><Implicit/><SequenceComponent><RelativeTypeName>Blob</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
<SequenceComponent RESTART="ON"><RelativeTypeName>FileNamePairs</RelativeTypeName>
<Range Min="1" Max="S"/>
</SequenceComponent>
<SequenceComponent><RelativeTypeName>BlobTrailer</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
</Sequence>
</GROUP>
<ITEM SimpleTypeName="Filename" CategoryOrItemParent="ZipFile" partition="NO" OrderSubtypes="ASCENDING"><CharTextWestern><Size Min="0" Max="S"/>
<Western CharSet="NATIVE"/>
<ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
</CharTextWestern>
</ITEM>
<GROUP SimpleTypeName="FileNamePairs" CategoryOrGroupParent="ZipFile" OrderSubtypes="ASCENDING"><Sequence partition="YES"><Implicit/></Sequence>
</GROUP>
<GROUP SimpleTypeName="InitialFileNamePair" CategoryOrGroupParent="FileNamePairs ZipFile" OrderSubtypes="ASCENDING"><TypeSyntax><TERMINATOR><Literal IgnoreCase="NO"><Western CharSet="NATIVE"/>
<LiteralValue><<50>><<4B>><<01>><<02>><<14>></LiteralValue>
</Literal>
</TERMINATOR>
</TypeSyntax>
<Sequence partition="NO"><Implicit/><SequenceComponent><RelativeTypeName>Filler_41</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
<SequenceComponent><RelativeTypeName>Filename</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
</Sequence>
</GROUP>
<GROUP SimpleTypeName="LastFileNamePair" CategoryOrGroupParent="FileNamePairs ZipFile" OrderSubtypes="ASCENDING"><TypeSyntax><TERMINATOR><Literal IgnoreCase="NO"><Western CharSet="NATIVE"/>
<LiteralValue><<50>><<4B>><<05>><<06>></LiteralValue>
</Literal>
</TERMINATOR>
</TypeSyntax>
<Sequence partition="NO"><Implicit/><SequenceComponent><RelativeTypeName>Filler_41</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
<SequenceComponent><RelativeTypeName>Filename</RelativeTypeName>
<Range Min="1" Max="1"/>
</SequenceComponent>
</Sequence>
</GROUP>
<ITEM SimpleTypeName="Filler_41" CategoryOrItemParent="ZipFile" partition="NO" OrderSubtypes="ASCENDING"><CharTextWestern><Size Min="41" Max="41"/>
<Western CharSet="NATIVE"/>
<ValueRestrictions IgnoreCase="NO" Rule="INCLUDE"></ValueRestrictions>
</CharTextWestern>
</ITEM>
</NEWTREE>
</TTMAKER>[/code]
#IBMSterlingTransformationExtender#DataExchange#IBM-Websphere-Transformation-Extender