ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-dev
xml-dev
[PMX:##] [xml-dev] Thanks joe (WAS: How do I include JavaScript inside an XML document?)
by tariq abdur-rahim other posts by this author
Sep 23 2002 10:18PM messages near this date
RE: [xml-dev] Fwd: War of Attrition (was: [xml-dev] Underwhelmed (WAS: [xml-dev] XOM micro tutorial)) | [xml-dev] Why Are Inner and Outer Unclean? (WAS RE: [xml-dev] Underwhelmed (WAS: [xml-dev] XOM micro tutorial))
Hey joe: 
Thanks for the quicc response.  This helps alot. 

Appreciate it, 

 Joe English wrote: 
tariq abdur-rahim wrote:

>  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?

Heh.

Yes. In fact, that's the default behaviour: data in
an XML document doesn't _do_ anything on its own
until some process interprets it. 

Also, you may find the construct helpful.
Inside a CDATA section, you don't have to escape &, <, or > ,
so you can basically copy-and-paste whatever you want
as long as it doesn't contain the closing delimiter "]]> ".

Quoting ,
section 3, question 2:

| Q. How do I include JavaScript inside an XML document?
|
| A. Easy! Just write:
|
| | ... your JavaScript code goes here ...
| ... make sure it doesn't contain the sequence "]]> "...
| ]]> 
| 


This is the first time I've ever heard anyone ask that question
who was expecting that answer though...


--Joe English

jenglish@[...].com

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org , an
initiative of OASIS 

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: 


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!
Attachments:
unknown1


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved