[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Is it possible to include JavaScript...in an XML file...?

  • To: xml-dev@l...
  • Subject: Is it possible to include JavaScript...in an XML file...?
  • From: tariq abdur-rahim <ecliptoid330@y...>
  • Date: Mon, 23 Sep 2002 14:19:33 -0700 (PDT)

include javascript

Hey all:

Quicc question...Is it possible to include JavaScript "source code" in an XML file and have it displayed as parsed data as opposed to it trying to perform a function? 

For example:

Is possible to include the following...

-- Code Snippet. --

&#lt;script language="JavaScript" type="text/JavaScript"&#gt;<br /><br />

document.write<br />

("&#lt;p class='10'&#gt;&#lt;strong&#gt;Document Purpose:&#lt;/strong&#gt; Used to create a CommentNode in XML Tree document.")<br />

document.write<br />

("&#lt;br /&#gt;&#lt;strong&#gt;Language(s):&#lt;/strong&#gt; XML, JavaScript, vbScript")<br /><br />

&#lt;/script&#gt;<br /><br />

&#lt;script language="vbScript" type="text/vbScript"&#gt;<br /><br />

set xmlDoc=CreateObject("Microsoft.XMLDOM")<br />

xmlDoc.async="false"<br />

xmlDoc.load("xml/genXML.xml")<br />

document.write("&#lt;p class='bold'&#gt;")<br />

document.write("The original XML document:")<br />

document.write("&#lt;xmp&#gt;" & xmlDoc.xml & "</xmp&#gt;")<br />

document.write("&#lt;/p&#gt;")<br /><br />

set newnode=xmldoc.createComment(" This is a comment node. ")<br />

xmldoc.documentElement.appendchild(newnode)<br /><br />

document.write("&#lt;p class='bold'&#gt;")<br />

document.write("After appending the new node:")<br />

document.write("&#lt;xmp&#gt;" & xmlDoc.xml & "&#lt;/xmp&#gt;")<br />

document.write("&#lt;/p&#gt;")<br />

&#lt;/script&#gt;

-- Blah, blah, blah... --

If yes, how do i go about doing this.  i know that it can be done using XSLT, but is that my only recourse?

 

Thanks in advance.

One,

 



t a r i q   a m i n   a b d u r - r a h i m

--  i am what's next!



Do you Yahoo!?
New http://rd.yahoo.com/evt=1207/*http://sbc.yahoo.com/ from SBC & Yahoo!

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.