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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] SWF using XML

[ Lists Home | Date Index | Thread Index ]

The examples are attatched
If they are not quite what you want email me.
Good luck
----- Original Message ----- 
From: "Sandeep Paradkar" <sandeep.paradkar@learningmate.com>
To: "'xml-dev'" <xml-dev@lists.xml.org>
Sent: Tuesday, 21 January 2003 05:08
Subject: [xml-dev] 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@yahoo.com.au
<?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@yahoo.com.au";>rcxau@yahoo.com.au</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:
    • SWF using XML
      • From: "Sandeep Paradkar" <sandeep.paradkar@learningmate.com>


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

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