XSLT를 이용하여 WebLogic EJB Deployment Descriptor의 자동 변환이 가능하다.
아래와 ANT를 이용하여 자동으로 변환하도록 설정할 수 있다.
XSLT를 이용하여 변환한 파일을 jar파일의 /META-INF/jboss.xml파일로 추가하여 deploy하면 된다.
build.xml파일
<project name="JBoss" default="webdocs" basedir="./">
<target name="webdocs">
<xslt basedir="in" destdir="out"
includes="weblogic-ejb-jar.xml"
extension=".xmls"
style="xslt/jboss.xslt"/>
<move file="out/weblogic-ejb-jar.xmls" tofile="out/jboss.xml"/>
<copy file="out/jboss.xml" tofile="in/jboss.xml"/>
</target>
</project>
jboss.xslt 파일
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="xml" doctype-public="-//JBoss//DTD
JBOSS 4.0//EN"
doctype-system="http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd"/>
<xsl:template match="/weblogic-ejb-jar"><jboss>
<enterprise-beans>
<xsl:apply-templates select="weblogic-enterprise-bean"/></enterprise-beans>
</jboss>
</xsl:template>
<xsl:template match="weblogic-enterprise-bean">
<xsl:if test="entity-descriptor">
<entity><xsl:copy-of select="ejb-name"/><xsl:copy-of
select="jndi-name"/><xsl:copy-of
select="local-jndi-name"/></entity></xsl:if>
<xsl:if test="stateful-session-descriptor">
<session><xsl:copy-of select="ejb-name"/><xsl:copy-of
select="jndi-name"/><xsl:copy-of
select="local-jndi-name"/></session></xsl:if>
<xsl:if test="stateless-session-descriptor">
<session><xsl:copy-of select="ejb-name"/><xsl:copy-of
select="jndi-name"/><xsl:copy-of
select="local-jndi-name"/></session></xsl:if></xsl:template>
</xsl:stylesheet>