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

Re: SWF using XML

swf xml
The examples are attatched
If they are not quite what you want email me.
Good luck
----- Original Message ----- 
From: "Sandeep Paradkar" <sandeep.paradkar@l...>
To: "'xml-dev'" <xml-dev@l...>
Sent: Tuesday, 21 January 2003 05:08
Subject:  SWF using XML

> Hi,
> I am using an xml file to store data and html as my presentation layer. I
> need to call different swf files through the xml file. The swf files are
> stored in the same folder. How do I do the same?
> Regards,
> Sandeep
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at http://lists.xml.org/archives/xml-dev/
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"

<xsl:template match="/">
<body><font face="courier new">
   <xsl:apply-templates select="//body" />


<xsl:template match="name">
<h2><xsl:value-of select="@value" /></h2>

<xsl:template match="commenta">
<font face="courier new" color="green"><i>
<h4><xsl:value-of select="." /></h4>

<xsl:template match="link">
<font face="courier new" color="blue"><u>
<h5><a href="{@location}"><xsl:value-of select="." /></a></h5>

<!--The XSL for the SWF (explanation below)-->

<xsl:template match="swf">	

<br />	
<object type="application/x-shockwave-flash" data="{@src}" 
	width="{@width}" height="{@height}">
	<param name="movie" value="{@src}" />


How it works

The above <xsl:template match="swf"> tells it what to do if it finds a <swf /> tag 

You can put any HTML tag between the <xsl:template match="swf"> 
tags. So long as it closes eg <img src="image.jpg > becomes <img src="image.jpg />
note the /> at the end. The same applies with any other tags that dont usually
have a closing tag eg. <br />. So all tags must close.

The {@src}looks in the tag <swf /> for an attribute <swf src="" />
The same applies with height {@height} and width {@width}

so i could put a tag called say: 
<bob>Hello </bob>
in the XML

and in the XSL have
<xsl:template match="bob">	
<br />	
<xsl:value-of select="." />

and when viewed in a browser
it will write whatever is between the <bob></bob>
tags in BOLD 

Mail me if you need more info rcxau@y...
<?xml version="1.0" encoding="UTF-8"?>
<!--Telling the parser to use the XSLT stylesheet-->
<?xml-stylesheet href="swf.xsl" type="text/xsl"?>

<name value="SWF in XML" />
Feel free to e-mail me if you need any more help
If this isn't what you want or you want to know how to do something with it
<link location="mailto:rcxau@y...";>rcxau@y...</link>

<!-- Inserting .SWF -->
<!--The below tag might seem short but most of the code is hidden in the XSLT-->
<swf src="swf_file.swf" height="200" width="400" />


  • References:


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.
First Name
Last Name
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.