Is it possible to attach javascript to an XML file like in HTML ? (I am new to XML.)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Only in XML-based languages that have a specific mechanism for attaching javascript.
eg. XHTML:
or SVG:
For generic XML, you would have to use an
<?xml-stylesheetto transform it into one of those languages to get the ability to include a script. (There are also extensions to XSLT in some implementations that can execute script as part of the transformation process, but I’m guessing that’s not what you’re after.)Otherwise, plain XML, as viewed in a browser’s generic XML viewer, does not have the ability to script.