Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


function vbscript inside xsl

From: "Ghena" <lastminutesud@-----.--->
To: NULL
Date: 6/1/2006 7:03:00 PM

I'm really in Hard situation:
I must create a function able to get the currency value  from an xml
source.

The function it will be similar to the following:





after in a xsl stylesheet I must call the function in this way:


<msxsl:script language=VbScript" implements-prefix="vb">

<![CDATA[
function  getCurrency(CODE)

Dim XmlDocument, Rate
Set XmlDocument = CreateObject("Msxml2.DOMDocument.3.0")
XmlDocument.async = False
If XmlDocument.load("valute1.xml") Then
   XmlDocument.setProperty "SelectionLanguage", "XPath"
   Set Rate =
XmlDocument.selectSingleNode("/CommandList/GetCurrencies/CurrencyList/Currency/Code[.
= 'CODE']/following-sibling::UsdRate[1]/text()")
   If Not Rate Is Nothing Then
     Document.write "Rate is " & Rate.data
   Else
     Document.write "No rate found."
   End If
Else
   Document.write  "Parse error: " & _
     XmlDocument.parseError.reason
End If
END FUNCTION
]]>
</msxsl:script>

<xsl:variable name="value_currency"
select="="{vb:getCurrency(Price/Currency)}"/>
<xsl:value-of select="(Price/Amount) / $value_currency" />

In this way it must to find the code currency  e.g 'NOK' and get the
relative value e.g 89.7704 and then do a conversion from NOK to USD.

But It' doesnt work :)



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent