OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]

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 DSL Internet Access from SBC & Yahoo!



 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS