Click to See Complete Forum and Search --> : transformation on client side and data islands


tyris
July 20th, 2001, 08:04 AM
hi all,
i've found a tutorial here : http://www.vbpj.com/upload/free/features/vbpj/2001/06jun01/hr0106/hr0601-1.asp that could help me to create my own XSLT. the problem is that all the code used for the transformation is in VBscript. what i wanted to know is : is there a way to create MSXML3 objects, transform data island xml... in javascript ? i don't want to use vbscript.

is there a way to do this kind of stuff in javascript ? :

===========================================

this code is used to sort a table :


function sort(strField)
'change the sort order and redisplay
dim sortField
dim sortOrderAttribute
'Attach to select attribute of the sort element attribute
set sortField=Style.XMLDocument.selectSingleNode("//xsl:sort/@strField")
'Attach to the sort attribute
set sortOrderAttribute = _
Style.XMLDocument.selectSingleNode("//xsl:sort/@order")

'If you are already sorting by strField
if sortField.value = strField then
'change the order
if sortOrderAttribute.value = "descending" _
then
sortOrderAttribute.value = "ascending"
else
sortOrderAttribute.value = "descending"
end if
else
'sort ascending
sortField.value = strField
sortOrderAttribute.value = "ascending"
end if

set sortField = nothing
set sortOrderAttribute = nothing

DisplayArea.innerHTML = Data.transformNode _
(Style.DocumentElement)
end function

==============================================

this code is used in an hmtl file structured this way (and mine will be a bit the same):

<HTML>
<Head>

<Script language="vbscript">
option explicit
function window_onload()

transform()

end function

function transform()

DisplayArea.innerHTML = Data.transformNode _
(Style.DocumentElement)

end function

</Script>
</Head>
<body>

<XML id='Data'>
<Addresses>
<Address>
<id></id>
<FirstName></FirstName>
<LastName></LastName>
<State></State>
</Address>
</Addresses>
</XML>
<XML id='Style' src='Log.xsl'></XML>

<span id="DisplayArea"></span>

</body>
</HTML>


================================================



regards

Elise, XML learning girl :-)

tyris
July 25th, 2001, 05:54 AM
i've foud the answer by myself : of course it's possible

regards

Elise, XML learning girl :-)