Click to See Complete Forum and Search --> : How do I use Javascript in a XML part of a ASP Document?


smercer
12-07-2004, 01:57 AM
Hi all

I am having a problem which the select list boxes are not linking properly (there is no text in them).
However because I need to use Access 2000 with the webpage, it puts in all this garbage, and Because the XML code goes something like this:

<OBJECT id=MSODSC codeBase=file:F:\msowc.cab#version=9,0,0,3821
classid=CLSID:0002E530-0000-0000-C000-000000000046><PARAM NAME="XMLData" VALUE=
"<xml xmlns:a=&quot;urn:schemas-microsoft-com:office:access&quot;> <a:DataSourceControl>
<a:OWCVersion>9.0.0.3821</a:OWCVersion> <a:ConnectionString>Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data
Source=M:\BEC Website\BEC_Website.mdb;Jet OLEDB:System database=&amp;quot;&amp;quot;;Jet OLEDB:Database
Password=&amp;quot;&amp;quot;</a:ConnectionString> <a:MaxRecords>10000</a:MaxRecords>
<a:GridX>10</a:GridX> <a:GridY>10</a:GridY>

<!--This is the section I am having a problem with-->

<SCRIPT language=javascript>ListDateSources();</SCRIPT>
<!--End section I am having a problem with-->

<!--and I want to take out all the rest below-->

<!--Start_of_list_Day_1-->
<a:ElementExtension><a:ElementID>list_Day_1</a:ElementID><a:ListRowSource>qry_Web_Fst_Month_Day_1</a:ListRowSource><a:ListBoundField>Event_Number1</a:ListBoundField>
<a:ListDisplayField>Event_Heading4</a:ListDisplayField></a:ElementExtension>
<!--End_of_list_Day_1-->
<!--Start_of_list_Day_2-->
<a:ElementExtension><a:ElementID>list_Day_2</a:ElementID><a:ListRowSource>qry_Web_Fst_Month_Day_2</a:ListRowSource><a:ListBoundField>Event_Number2</a:ListBoundField>
<a:ListDisplayField>Event_Heading5</a:ListDisplayField></a:ElementExtension>
<!--End_of_list_Day_2-->
<!--Start_of_list_Day_3-->
<a:ElementExtension><a:ElementID>list_Day_3</a:ElementID><a:ListRowSource>qry_Web_Fst_Month_Day_3</a:ListRowSource><a:ListBoundField>Event_Number3</a:ListBoundField>
<a:ListDisplayField>Event_Heading6</a:ListDisplayField></a:ElementExtension>
<!--End_of_list_Day_3-->
<!--all the way to_list_Day_31-->

I think it may be better to write on the fly with javascript and increment the day numbers so that it only needs to be one line.

So I experiment with it and find that I can not use Javascript like I can with HTML.

You can see the full page in the attachment if you wish, (I have put in the scripts tags, but I put it in comments so that the XML works).


I am very new to XML and I am creating a calender of events, which is manly put together using Javascript and writes it in HTML.

Is there a way to do this with XML?

Thanks in advance

smercer
12-07-2004, 07:53 PM
Hi all

I found a web site on this but the code they supply is not working in my webpage. (same as before)


Quote from website:
http://www.flightlab.com/~joe/sgml/faq-not.txt
Part 3, question 2:

Q. How do I include JavaScript inside an XML document?

A. Easy! Just write:

<code notation="JavaScript"><![CDATA[
... your JavaScript code goes here ...
... make sure it doesn't contain the sequence "]]>"...
]]>
</code>

Note that this solution also works for Perl, Python, Tcl,
REXX, Icon, Ada, Basic, Beta, C, C++, Eiffel, Forth, Fortran,
Haskell, Scheme, SML, Pascal, Modula, PL/I, Prolog, REXX, Sather,
Smalltalk, SNOBOL, RPG/III, and COBOL.

Can some one please help me here? It's driveing me knuts (I mean nuts)

Thanks in advance!!!

smercer
12-09-2004, 06:16 AM
I got it fixed thanks

Thanks to any one who gave this brain time