hi all,
i've found a tutorial here : 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 :
==============================================
this code is used in an hmtl file structured this way (and mine will be a bit the same):
================================================
Best regards,
Elise, XML learning girl X-)
i've found a tutorial here : 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 :
Code:
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):
Code:
<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>
Best regards,
Elise, XML learning girl X-)