Problem using XSLProcessor.processXSL Method.
569700Mar 4 2008 — edited Mar 4 2008I try to transform an XMLElement with an existing XSL file using the method. It's weird that it returns me the values of all elements in that xml.
eg:
=======================INPUT======================
<?xml version = '1.0' encoding = 'UTF-8'?>
<ns0:MSH xmlns="NS_78E00E7A64D3416E91BA33D8A491856620080303090624" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="NS_78E00E7A64D3416E91BA33D8A491856620080303090624">
<ns0:MSH.1>|</ns0:MSH.1>
<ns0:MSH.2>^~\&</ns0:MSH.2>
<ns0:MSH.3>
<ns0:HD.1>MD</ns0:HD.1>
</ns0:MSH.3>
<ns0:MSH.4>
<ns0:HD.1>ddi</ns0:HD.1>
</ns0:MSH.4>
<ns0:MSH.5>
<ns0:HD.1>Health-e-link V1.0</ns0:HD.1>
</ns0:MSH.5>
<ns0:MSH.6>
<ns0:HD.1>NSWH</ns0:HD.1>
</ns0:MSH.6>
<ns0:MSH.7>
<ns0:TS.1>20080122144007+0800</ns0:TS.1>
</ns0:MSH.7>
<ns0:MSH.8 xsi:nil="true">
</ns0:MSH.8>
<ns0:MSH.9>
<ns0:MSG.1>REF</ns0:MSG.1>
<ns0:MSG.2>I12</ns0:MSG.2>
</ns0:MSH.9>
<ns0:MSH.10>1</ns0:MSH.10>
<ns0:MSH.11>
<ns0:PT.1>P</ns0:PT.1>
</ns0:MSH.11>
<ns0:MSH.12>
<ns0:VID.1>2.4</ns0:VID.1>
<ns0:VID.2>
<ns0:CE.1>AUS</ns0:CE.1>
</ns0:VID.2>
</ns0:MSH.12>
<ns0:MSH.13 xsi:nil="true">
</ns0:MSH.13>
<ns0:MSH.14 xsi:nil="true">
</ns0:MSH.14>
<ns0:MSH.15 xsi:nil="true">
</ns0:MSH.15>
<ns0:MSH.16>AL</ns0:MSH.16>
<ns0:MSH.17>AUS</ns0:MSH.17>
<ns0:MSH.18 xsi:nil="true">
</ns0:MSH.18>
<ns0:MSH.19>
<ns0:CE.1>EN</ns0:CE.1>
</ns0:MSH.19>
</ns0:MSH>
=======================OUTPUT======================
<?xml version = '1.0' encoding = 'UTF-8'?>
|
^~\&
MD
ddi
Health-e-link V1.0
NSWH
20080122144007+0800
REF
I12
1
P
2.4
AUS
AL
AUS
EN
the xsl file is:
=======================XSL FILE======================
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:ns0="NS_78E00E7A64D3416E91BA33D8A491856620080303090624"
xmlns:ns1="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
xmlns:tns="http://www.healthe.com/ws/phr/document"
xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
exclude-result-prefixes="xsl ns0 xsd ns1 tns xp20 bpws ora ehdr orcl ids hwf">
<xsl:template match="/">
<tns:messageHeader>
<tns:sendingApp>
<xsl:value-of select="/ns0:MSH/ns0:MSH.3/ns0:HD.1"/>
</tns:sendingApp>
<tns:sendingFacility>
<xsl:value-of select="/ns0:MSH/ns0:MSH.4/ns0:HD.1"/>
</tns:sendingFacility>
<tns:messageTime>
<xsl:value-of select="/ns0:MSH/ns0:MSH.7/ns0:TS.1"/>
</tns:messageTime>
<tns:countryCode>
<xsl:value-of select="/ns0:MSH/ns0:MSH.17"/>
</tns:countryCode>
<tns:controlId>
<xsl:value-of select="/ns0:MSH/ns0:MSH.10"/>
</tns:controlId>
<tns:language>
<xsl:value-of select="/ns0:MSH/ns0:MSH.19/ns0:CE.1"/>
</tns:language>
</tns:messageHeader>
</xsl:template>
</xsl:stylesheet>