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


Help: OASIS Mailing Lists Help | MarkMail Help



   Thanks joe (WAS: How do I include JavaScript inside an XML document?)

[ Lists Home | Date Index | Thread Index ]

Hey joe:

Thanks for the quicc response.  This helps alot.

Appreciate it,


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?


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


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

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