Re: [svg-developers] Re: read parameters of local file URL by IE / ASV3

2005-01-05 Thread Philippe Lhoste

Jim Ley wrote:
 rwkemper [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]

 thanks for the tip. URL in capitals works basically.
 BUT I can't get back the params in the url. Looks like they are cut
 off by IE6.
 I just get file:://J:\\spicechip.svg
 
 This always happen on file:// urls for IE, try it on a webserver and it will 
 work fine.

Oh great, and I was wondering why my example of bar chart with local 
data didn't worked as I wanted! I was just testing with local files!

I can't remember where was the original question, but I hope the author 
reads this message (or better, that he found himself the answer, as this 
one is coming a bit late...)

Inside an HTML file:

iframe id=GetData src=GetData.svg?20;50;150;100;200 height=400 
width=400 frameborder=no
title=Dynamic Data/iframe

With stuff around and perhaps inside the iframe.

The SVG file:

?xml version=1.0 encoding=ISO-8859-1 standalone=no?
!DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.0//EN
   http://www.w3.org/TR/SVG/DTD/svg10.dtd;
svg width=400px height=400px viewbox=0 0 400 400
  xmlns=http://www.w3.org/2000/svg;
  xmlns:xlink=http://www.w3.org/1999/xlink;
  onload=Init(evt)
  
   titleGet Data/title
   desc
Shows how to get parameters from the invocation of the SVG file
(URL parsing).
   /desc
   metadata!-- I use the Dublin Core, completed by private tags for 
stuff not covered by DC --
 pls:PLS
  xmlns:pls=http://Phi.Lho.free.fr/xmlns/pls/;
  xmlns:dc=http://purl.org/dc/elements/1.1/;
   dc:creator
 pls:namePhilippe Lhoste/pls:name
 pls:e-mailPhiLho(a)GMX.net/pls:e-mail
 pls:urlhttp://Phi.Lho.free.fr//pls:url
   /dc:creator
   dc:publisherPhiLhoSoft/dc:publisher
   dc:date2004-12-27/dc:date
   dc:rightsCopyright © 2004 Philippe Lhoste, PhiLhoSoft/dc:rights
   pls:history
1.0 -- 2004/12/27 -- Original release
   /pls:history
   dc:contributorNone yet/dc:contributor
   dc:sourceCode from Jan-Klaas Kollhof
  (parsing of URL data)/dc:source
   dc:typeDynamic Image/dc:type
   dc:formatimage/svg+xml/dc:format
   dc:languageen/dc:language
 /pls:PLS
   /metadata

script type=text/javascript
![CDATA[
// Init: code ran on loading document
var g_svgDoc, g_root;
var gc_svgNS = http://www.w3.org/2000/svg;;
var gc_baseX = 50;
var gc_baseY = 350;

function Init(evt)
{
   g_svgDoc = evt.target.ownerDocument;
   g_root = g_svgDoc.rootElement;

   g_output = [];
   try
   {
//alert(document.URL);
 var str = decodeURIComponent(document.URL + '?');
 var urlData = (str.split('?'))[1]
 g_output = urlData.split(';');
   }
   catch (e)
   {
 alert(Catch for URL parsing);
   }
   if (g_output.length = 1)
   {
 g_output = [ 10, 40, 150, 100 ];  // Dummy test
   }
   var d = ;
   for (var j = 0; j  g_output.length; j++)
   {
 try
 {
   var lc = g_output[j];
   d = d + lc + ;
   CreateBar(j, lc);
 }
 catch (e)
 {
   alert(Catch for CreateBar);
 }
   }
}

function CreateBar(pos, height)
{
   var shape = g_svgDoc.createElementNS(gc_svgNS, rect);
   shape.setAttributeNS(null, x, '' + (gc_baseX + pos * 50));
   shape.setAttributeNS(null, y, '' + (gc_baseY - height));
   shape.setAttributeNS(null, width,  50);
   shape.setAttributeNS(null, height,  '' + height);
   shape.setAttributeNS(null, fill,  lightgreen);
   shape.setAttributeNS(null, stroke,  orange);
   shape.setAttributeNS(null, stroke-width,  8);
   g_root.appendChild(shape);
}
//]]
/script

   g id=Title
 rect x=50 y=75 width=200 height=30
   fill=lightyellow stroke=blue
   stroke-width=4/
 text x=90 y=100 font-size=24
   fill=darkgreenA Bar Chart/text
 descTitle Bar/desc
   /g
/svg

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  For servers mangling my From and Reply-To fields,
--  please send private answers to PhiLho(a)GMX.net
--  --  --  --  --  --  --  --  --  --  --  --  --  --


-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] Re: read parameters of local file URL by IE / ASV3

2005-01-04 Thread Jim Ley


rwkemper [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 How can I get the file URL and it's params ?

document.URL 





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] Re: read parameters of local file URL by IE / ASV3

2005-01-04 Thread rwkemper



Jim, 
thanks for the tip. URL in capitals works basically.
BUT I can't get back the params in the url. Looks like they are cut 
off by IE6. 
I just get file:://J:\\spicechip.svg 
but no params behind.

I guess IE will not pass it to the ADOBE plugin correctly.
But I''m not sure at all.

Any idea ?

Rolf

--- In svg-developers@yahoogroups.com, Jim Ley [EMAIL PROTECTED] wrote:
 
 rwkemper [EMAIL PROTECTED] wrote in message 
 news:[EMAIL PROTECTED]
  How can I get the file URL and it's params ?
 
 document.URL





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





[svg-developers] Re: read parameters of local file URL by IE / ASV3

2005-01-04 Thread Jim Ley


rwkemper [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]



 Jim,
 thanks for the tip. URL in capitals works basically.
 BUT I can't get back the params in the url. Looks like they are cut
 off by IE6.
 I just get file:://J:\\spicechip.svg

This always happen on file:// urls for IE, try it on a webserver and it will 
work fine.

Jim. 





-
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click edit my 
membership
 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/