Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML inside Javascript

Status
Not open for further replies.

rjonesX

Technical User
Jun 18, 2001
56
US
Here is the plan... my xml file is structured like this

[node]
[issue]
[number]1[/number]
[detail]some text[/detail]
[/issue]
[issue]
[number]2[/number]
[detail]some text[/detail]
[/issue]
[issue]
[number]3[/number]
[detail]some text[/detail]
[/issue]
[/node]


basically, im trying to get inside the javascript between the head tags of an xsl page to repeat this pattern

messages[0]=""

where the 0 becomes the "number" node and the "" is filled with the corresponding value of the detail node. This is all inside a javascript array. any ideas?

here is what i came up with ... but it is apparantly not working...

messages=new Array()
<xsl:for-each select=&quot;mckinney/site/issues&quot; order-by=&quot;number&quot;>
messages[
<xsl:value-of select=&quot;mckinney/site/issues/number&quot; />
]=&quot;
<xsl:value-of select=&quot;mckinney/site/issues/detail&quot; />
&quot;
</xsl:for-each>

and, does it matter that this is all in a CDATA section?

just wondering


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top