使用 IBM Data Studio Developer 中的 XSLT 转换 Data Web Services 消息(下)
2010-04-15 00:00:00 来源:WEB开发网
<?xml version="1.0" encoding="UTF-8"?>
<!-- @generated mapFile="NewMAPOutput.map" md5sum="6d0669dbb4a79476379126c435e48f52"
version="1.0.120" -->
<!--
*****************************************************************************
* This file has been generated by the IBM XML Mapping Editor V1.0.120
*
* Mapping file: NewMAPOutput.map
* Map declaration(s): NewMAPOutput
* Input file(s):
* DataServerWebServices/MyWebServiceXSLT/MyWebServiceXSLT.getOneEmp.default.xsd
* Output file(s): NewXMLSchemaOutput.xsd
*
* Note: Do not modify the contents of this file as it is overwritten
* each time the mapping model is updated.
*****************************************************************************
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:in="urn:example"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:out="http://www.example.org/getHREmpDetails"
exclude-result-prefixes="in xalan"
version="1.0">
<xsl:output method="xml" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/>
<xsl:strip-space elements="*"/>
<!-- root template -->
<xsl:template match="/">
<xsl:apply-templates select="in:getOneEmpResponse" mode="NewMAPOutput"/>
</xsl:template>
<!-- This rule represents an element mapping:
"in:getOneEmpResponse" to "out:getHREmpDetails". -->
<xsl:template match="in:getOneEmpResponse" mode="NewMAPOutput">
<out:getHREmpDetails>
<out:HREmpPersonalDetails>
<!-- a simple data mapping:
"row/FIRSTNME"(String) to "out:EMP_FIRSTNAME"(String) -->
<out:EMP_FIRSTNAME>
<xsl:value-of select="row/FIRSTNME"/>
</out:EMP_FIRSTNAME>
<!-- a simple data mapping:
"row/MIDINIT"(String) to "out:EMP_MIDINIT"(String) -->
<out:EMP_MIDINIT>
<xsl:value-of select="row/MIDINIT"/>
</out:EMP_MIDINIT>
<!-- a simple data mapping:
"row/LASTNAME"(String) to "out:EMP_LastNAME"(String) -->
<out:EMP_LastNAME>
<xsl:value-of select="row/LASTNAME"/>
</out:EMP_LastNAME>
<!-- a simple data mapping:
"row/SEX"(String) to "out:EMP_SEX"(String) -->
<out:EMP_SEX>
<xsl:value-of select="row/SEX"/>
</out:EMP_SEX>
<!-- a simple data mapping:
"row/BIRTHDATE"(Date) to "out:EMP_BDATE"(Date) -->
<out:EMP_BDATE>
<xsl:value-of select="row/BIRTHDATE"/>
</out:EMP_BDATE>
</out:HREmpPersonalDetails>
<out:HREmpSalaryDetails>
<!-- a simple data mapping:
"row/EMPNO"(String) to "out:EMP_SERIAL"(String) -->
<out:EMP_SERIAL>
<xsl:value-of select="row/EMPNO"/>
</out:EMP_SERIAL>
<!-- a simple data mapping:
"row/SALARY"(Decimal) to "out:EMP_YEARLY_COMP"(Decimal) -->
<out:EMP_YEARLY_COMP>
<xsl:value-of select="row/SALARY"/>
</out:EMP_YEARLY_COMP>
<!-- a simple data mapping:
"row/BONUS"(Decimal) to "out:EMP_MIDYEAR_BONUS"(Decimal) -->
<out:EMP_MIDYEAR_BONUS>
<xsl:value-of select="row/BONUS"/>
</out:EMP_MIDYEAR_BONUS>
<!-- a simple data mapping:
"row/COMM"(Decimal) to "out:EMP_YEAREND_BONUS"(Decimal) -->
<out:EMP_YEAREND_BONUS>
<xsl:value-of select="row/COMM"/>
</out:EMP_YEAREND_BONUS>
</out:HREmpSalaryDetails>
<out:HREmpWorkDetails>
<!-- a simple data mapping:
"row/WORKDEPT"(String) to "out:EMP_DEPT"(String) -->
<out:EMP_DEPT>
<xsl:value-of select="row/WORKDEPT"/>
</out:EMP_DEPT>
<!-- a simple data mapping:
"row/PHONENO"(String) to "out:EMP_WORKNO"(String) -->
<out:EMP_WORKNO>
<xsl:value-of select="row/PHONENO"/>
</out:EMP_WORKNO>
<!-- a simple data mapping:
"row/HIREDATE"(Date) to "out:EMP_HIREDATE"(Date) -->
<out:EMP_HIREDATE>
<xsl:value-of select="row/HIREDATE"/>
</out:EMP_HIREDATE>
<!-- a simple data mapping:
"row/JOB"(String) to "out:EMP_JOBDESC"(String) -->
<out:EMP_JOBDESC>
<xsl:value-of select="row/JOB"/>
</out:EMP_JOBDESC>
<!-- a simple data mapping:
"row/EDLEVEL"(Short) to "out:EMP_EDLEVEL"(Short) -->
<out:EMP_EDLEVEL>
<xsl:value-of select="row/EDLEVEL"/>
</out:EMP_EDLEVEL>
</out:HREmpWorkDetails>
</out:getHREmpDetails>
</xsl:template>
<!-- ***************** Utility Templates ****************** -->
<!-- copy the namespace declarations from the source to the target -->
<xsl:template name="copyNamespaceDeclarations">
<xsl:param name="root"/>
<xsl:for-each select="$root/namespace::*">
<xsl:copy/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
更多精彩
赞助商链接