123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #if($tools.isNotNullAndBlank($!map.get("sortCode")))
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE xMessage SYSTEM "../framecomm.dtd">
- <!-- $!map.get("name") -->
- <xMap tag="body" >
- #end
- ##变量定义段
- #set ($tmp0='"')
- #foreach($param in ${map.keySet()})
- #set($itemType=$map.get($param).get("数据类型"))
- #set($itemCode=$map.get($param).get("英文名称"))
- #set($itemName=$map.get($param).get("中文名称"))
- #set($itemTag=$map.get($param).get("TAG标签"))
- #set($itemDefault=$map.get($param).get("默认值"))
- #set($itemFormat=$map.get($param).get("格式化"))
- #set($itemNotNull=$map.get($param).get("非空/引用"))
- #set($xmlStyle=$map.get($param).get("XML样式"))
- #set($xmlMapping=$map.get($param).get("映射/子标签"))
- #set($itemCdata=$map.get($param).get("CDATA"))
- #set($itemReferred=$map.get($param).get("REFERRED"))
- ##以下为字符输出段
- #if($tools.isNullAndBlank($itemTag))
- #set($itemTag=$itemCode)
- #end
- ##
- #if($tools.toBool($itemReferred))
- #set($referredStr="referred="+$tmp0+"true"+$tmp0)
- #else
- #set($referredStr="")
- #end
- ##
- #if($tools.isNotNullAndBlank($itemNotNull))
- #set($countNameStr="countName="+$tmp0+"$itemNotNull"+$tmp0)
- #else
- #set($countNameStr="")
- #end
- ##
- #if($tools.isNotNullAndBlank($itemCdata))
- #set($itemCdataStr="cdata="+$tmp0+"$itemCdata"+$tmp0)
- #else
- #set($itemCdataStr="")
- #end
- ##
- #if($tools.isNotNullAndBlank($xmlMapping))
- #set($xmlMappingStr="mapping="+$tmp0+"$xmlMapping"+$tmp0)
- #else
- #set($xmlMappingStr="")
- #end
- ##
- #if($tools.isNotNullAndBlank($xmlStyle))
- #set($xmlStyleStr="xmlStyle="+$tmp0+"$xmlStyle"+$tmp0)
- #else
- #set($xmlStyleStr="")
- #end
- ##
- #if($tools.isNotNullAndBlank($itemDefault))
- #set($itemDefaultStr="default="+$tmp0+"$itemDefault"+$tmp0)
- #else
- #set($itemDefaultStr="default="+$tmp0+$tmp0)
- #end
- ##
- #if($tools.isNotNullAndBlank($itemFormat))
- #set($itemFormatStr="pattern="+$tmp0+"$itemFormat"+$tmp0)
- #else
- #set($itemFormatStr="")
- #end
- ##
- #if($tools.toBool($itemNotNull))
- #set($optionalStr="optional="+$tmp0+"flase"+$tmp0)
- #else
- #set($optionalStr="optional="+$tmp0+"true"+$tmp0)
- #end
- ##迭代输出
- ##
- #if($tools.equals("bytes",$itemType))
- <!-- $itemName -->
- #if($tools.isNullAndBlank($itemFormat))
- <xString name="$itemCode" tag="$itemTag" $optionalStr $xmlMappingStr $itemCdataStr />
- #else
- #if($tools.equals("hex",$itemFormat))
- <xString name="$itemCode" tag="$itemTag" $optionalStr $xmlMappingStr $itemCdataStr encoding="hex" />
- #elseif($tools.equals("base64",$itemFormat))
- <xString name="$itemCode" tag="$itemTag" $optionalStr $xmlMappingStr $itemCdataStr encoding="base64" />
- #else
- <xString name="$itemCode" tag="$itemTag" $optionalStr $xmlMappingStr $itemCdataStr />
- #end
- #end
- #end
- ##
- #if($tools.equals("date",$itemType))
- <!-- $itemName -->
- <xDate name="$itemCode" tag="$itemTag" $itemFormatStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr/>
- #end
- ##
- #if($tools.equals("decimal",$itemType))
- <!-- $itemName -->
- <xDecimal name="$itemCode" tag="$itemTag" default="0" $itemFormatStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr/>
- #end
- ##
- #if($tools.equals("double",$itemType))
- <!-- $itemName -->
- <xDouble name="$itemCode" tag="$itemTag" default="0" $itemFormatStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr/>
- #end
- ##
- #if($tools.equals("int",$itemType))
- <!-- $itemName -->
- <xInteger name="$itemCode" tag="$itemTag" default="0" $itemFormatStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr $referredStr/>
- #end
- ##
- #if($tools.equals("long",$itemType))
- <!-- $itemName -->
- <xLong name="$itemCode" tag="$itemTag" default="0" $itemFormatStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr $referredStr/>
- #end
- ##
- #if($tools.equals("string",$itemType))
- <!-- $itemName -->
- <xString name="$itemCode" tag="$itemTag" $itemDefaultStr $optionalStr $xmlStyleStr $xmlMappingStr $itemCdataStr/>
- #end
- ##
- #if($tools.equals("list",$itemType))
- <!-- $itemName -->
- <xList name="$itemCode" tag="$itemTag" $countNameStr>
- #if($tools.isNullAndBlank($xmlMapping))
- <xMap name="map" tag="map" xmlStyle=".none">
- #else
- <xMap name="map" tag="$xmlMapping">
- #end
- $engine.xmlEncode($map.get($param))
- </xMap>
- </xList>
- #end
- ##
- #if($tools.equals("map",$itemType))
- <!-- $itemName -->
- <xMap name="$itemCode" tag="$itemTag">
- $engine.xmlEncode($map.get($param))
- </xMap>
- #end
- ##
- #end
- #if($tools.isNotNullAndBlank($!map.get("sortCode")))
- </xMap>
- #end
|