You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Maloy Chakraborty <ma...@yahoo.com> on 2013/06/20 21:56:04 UTC

Need help calling JAR

Hello 
 
Thanks in advance for looking at my problem with XALAN. 
 
In my xslt, I am calling a java method which is in my JAR. Not sure what is wrong but xlst/xalan can not find the method. Is there any way to import the package or jar (java equivalent of import ) ? 
 
Here is my xslt : 
<?xml version="1.0" ?>
<xsl:stylesheet version="1.1" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:IOutput="com.wm.pkg.xslt.extension.IOutputMap"
  xmlns:xalan="htttp://xml.apache.org/xslt"
  xmlns:xct="xalan://com.telus.ehealth.dtsmaintenance.TerminologyMaintenance" 
  exclude-result-prefixes="IOutput xct"
        extension-element-prefixes="xct"
  xmlns:hl7="urn:hl7-org:v3" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="output"/>
  <xsl:template match="@* | node()">
  <xsl:copy>
   <xsl:apply-templates select="@* | node()"/>
  </xsl:copy>
 </xsl:template>
 <xsl:template match="*">
  <!-- create the element with the correct namespace -->    
  <xsl:element name="hl7:{local-name()}" namespace="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <xsl:apply-templates select="node() | @*" />
  </xsl:element>
 </xsl:template>
 
  <xsl:template match="hl7:processingCode">
 <xsl:choose>
  <xsl:when test="element-available('xct:TerminologyMaintenanceInvoke')">
FOUNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
    <xct:translate domain="ClinicalActCode" prefix="hl7" />
  </xsl:when>
  <xsl:otherwise>
NOTFOUNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
   <xsl:apply-templates select="@* | node()"/>
  </xsl:otherwise>
   </xsl:choose>
  </xsl:template>
</xsl:stylesheet>

Thanks
Maloy Chakraborty
Phone : 416-564-9125   

Re: Need help calling JAR

Posted by "USHAKOV, Sergey" <s-...@yandex.ru>.
Hi Maloy,

without promising I that I will be able to help you, could you kindly first:
1) move the rest of this discussion to the users' list: 
mailto:j-users@xalan.apache.org
2) post both your java command line and the error output

Or do you maybe call XALAN-J from your application?

And as the first step, make sure that 
'com.telus.ehealth.dtsmaintenance.TerminologyMaintenance' and maybe 
'com.wm.pkg.xslt.extension.IOutputMap' (I did not notice the latter 
being used though) are on your classpath...

It may be a good idea also to check yourself against 
http://xml.apache.org/xalan-j/extensions.html#ext-func-calls and 
http://xml.apache.org/xalan-j/extensions.html#java-namespace-declare ...

Regards,
Sergey


On 20.06.13 23:56, Maloy Chakraborty wrote:
> Hello
> Thanks in advance for looking at my problem with XALAN.
> In my xslt, I am calling a java method which is in my JAR. Not sure 
> what is wrong but xlst/xalan can not find the method. Is there any way 
> to import the package or jar (java equivalent of import ) ?
> Here is my xslt :
> <?xml version="1.0" ?>
> <xsl:stylesheet version="1.1"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>         xmlns:IOutput="com.wm.pkg.xslt.extension.IOutputMap"
>   xmlns:xalan="htttp://xml.apache.org/xslt"
>   xmlns:xct="xalan://com.telus.ehealth.dtsmaintenance.TerminologyMaintenance" 
>
>   exclude-result-prefixes="IOutput xct"
>         extension-element-prefixes="xct"
>   xmlns:hl7="urn:hl7-org:v3"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
> <xsl:output omit-xml-declaration="yes" indent="yes"/>
> <xsl:param name="output"/>
>   <xsl:template match="@* | node()">
>   <xsl:copy>
>    <xsl:apply-templates select="@* | node()"/>
>   </xsl:copy>
>  </xsl:template>
>  <xsl:template match="*">
>   <!-- create the element with the correct namespace -->
>   <xsl:element name="hl7:{local-name()}" namespace="urn:hl7-org:v3" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>    <xsl:apply-templates select="node() | @*" />
>   </xsl:element>
>  </xsl:template>
>   <xsl:template match="hl7:processingCode">
>  <xsl:choose>
>   <xsl:when test="element-available('xct:TerminologyMaintenanceInvoke')">
> FOUNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
>     <xct:translate domain="ClinicalActCode" prefix="hl7" />
>   </xsl:when>
>   <xsl:otherwise>
> NOTFOUNDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
>    <xsl:apply-templates select="@* | node()"/>
>   </xsl:otherwise>
>    </xsl:choose>
>   </xsl:template>
> </xsl:stylesheet>
> Thanks
> Maloy Chakraborty
> Phone : 416-564-9125


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org
For additional commands, e-mail: dev-help@xalan.apache.org