Forum Moderators: open

Message Too Old, No Replies

Adjusting xml

         

miramax

3:30 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



I just find the XML Flash gallery that is close to my needs. But it run on aspx server. I want adjust it for use it on any web hosting, not on aspx. I have download SWF and XML files.
So now I need adjust html code a little (xml patches) to make it work on any web server, not on aspx only. How to adjust it?

Here is part of xml file:

<?xml version="1.0"?>
- <slideShow>
- <image>
<path>/winter/assets/gallery/1.jpg</path>
<caption>December 29, 2006: Getting ready to Chair.</caption>
</image>
- <image>
<path>/winter/assets/gallery/2.jpg</path>
<caption>February 8, 2006: Snowboard at Sun Peaks photo: Adam Benton</caption>
</image>
- <image>
<path>/winter/assets/gallery/3.jpg</path>
<caption>March 9, 2006: Telemark turns on Bushwacker. Photo: Corey Wilson</caption>
</image>
... ... ... ...

</slideShow>

Here is html code of gallery:

<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0', 'width', '767', 'height', '550', 'id', 'Gallery', 'align', 'middle', 'src', 'gallery/Gallery?xmlPath=gallery/xml.aspx', 'quality', 'high', 'wmode', 'opaque', 'bgcolor', '#ffffff', 'name', 'Gallery', 'allowscriptaccess', 'sameDomain', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'movie', 'gallery/Gallery?xmlPath=gallery/xml.aspx' ); //end AC code
</script><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gallery/Gallery.swf?xmlPath=gallery/xml.aspx" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="gallery/Gallery.swf?xmlPath=gallery/xml.aspx" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>
<!-- end gallery code -->

[edited by: jatar_k at 4:03 pm (utc) on Sep. 21, 2007]
[edit reason] fixed sidescroll [/edit]

cmarshall

3:32 pm on Sep 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi miramax, and welcome to WebmasterWorld!

The answer is in XSLT [w3schools.com].

I can't make the time right now to go through your specific code, but this is exactly what XSLT was designed to do.

miramax

6:55 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



not sure how XSLT can help here. The task is just porting gallery to non-aspx host and make it to work.
I tried the following, but not work:

<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','767','height','550','id','Gallery','align','middle','src',
'Gallery?xmlPath=gallery.xml','quality','high','wmode','opaque','bgcolor','#ffffff','name',
'Gallery','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Gallery?xmlPath=gallery.xml' ); //end AC code
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Gallery.swf?xmlPath=gallery.xml" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="Gallery.swf?xmlPath=gallery.xml" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>

<!-- end gallery code -->

Maybe "AC_FL_RunContent" not work on non-aspx servers?

[edited by: tedster at 3:21 pm (utc) on Oct. 2, 2007]
[edit reason] fix side-scroll [/edit]

cmarshall

7:21 pm on Sep 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You got me there. XSLT will transform any XML you want, but I don't know the particulars of the system that you're using. I don't do ASPX.

This is probably not an XML/XSLT question.

miramax

9:56 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



Having studied a code, I've found an error - there was missing JavaScript include statement that points to external AC_RunActiveContent.js file, since code include a function call for Flash content: AC_FL_RunContent.

I added an include statement <script src="AC_RunActiveContent.js" type="text/javascript"></script> and tested page offline (all files on desktop) - it works fine.
But not work on web server. I suspect, that its may be connected with the path to files: should be absolute, or relative path used?

<BODY>
<script src="AC_RunActiveContent.js" type="text/javascript"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">

<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','767','height','550','id','Gallery','align','middle','src',
'Gallery?xmlPath=gallery.xml','quality','high','wmode','opaque','bgcolor','#ffffff','name',
'Gallery','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Gallery?xmlPath=gallery.xml' ); //end AC code
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Gallery.swf?xmlPath=gallery.xml" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="Gallery.swf?xmlPath=gallery.xml" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>

<!-- end gallery code -->

</BODY>

-----
<?xml version="1.0"?>

<slideShow>
<image>
<path>picture1.jpg</path>
<caption>Picture 1</caption>
</image>
<image>
<path>picture2.jpg</path>
<caption>Picture 2</caption>
</image>
... ...
</slideShow>

[edited by: tedster at 3:20 pm (utc) on Oct. 2, 2007]
[edit reason] fix side scroll [/edit]

cmarshall

10:43 pm on Sep 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sadly, I cannot help you here. It is not an XML problem.

httpwebwitch

5:21 am on Oct 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hey miramax, did you get this solved?

curious... since it works fine on the desktop, but not when run on a server... you might be dealing with a domain-crippled SWF.

I've used the technique myself to prevent others from stealing my SWFs and using them on other sites. In frame 1 of the SWF, I'd put in a little actionscript that looks for the "domain" - this is an environment variable in Actionscript - and if it is anything other than "localhost" or "example.com", the SWF would promptly stop everything.

To find out if this is the problem, you'll have to crack open the SWF with a decompiler.

But that's just a guess. "not work on web server" is not sufficient for anyone to help you debug - could you explain in greater detail what you see? are there error messages or output?

miramax

11:28 am on Oct 11, 2007 (gmt 0)

10+ Year Member



Issue solved. Problem had not linked to path. Thing was much simple: at uploading stuff on a webserver, it damaged SWF file extension, I did not notice this. After renaming file, all works fine.