Loading ...
Sorry, an error occurred while loading the content.

RE: [svg-developers] Re: The best way

Expand Messages
  • Chris Peto
    Hi, One more thing. Why would you need to change the attributes of the external svg and it s viewbox? If you set it up correctly the external svg will scale
    Message 1 of 16 , Feb 2, 2004
    • 0 Attachment
      Hi,

      One more thing. Why would you need to change the attributes of the external
      svg and it's viewbox? If you set it up correctly the external svg will
      scale it's self.

      Mit freundlichen Grüßen/Regards
      Chris Peto
      Freelance System Development
      ------------------------------------
      Resource Solutions
      Germany
      Mobile: +49 (0) 173 308 7843
      Tel:+49(0) 6103 80 21 98
      Web: http://www.resource-solutions.de
      SVG editor: http://www.resource-solutions.de/svgeditor.html
      mailto:CPeto@...
      ------------------------------------
      Member of: SPARK - SVG Programmers' Application Resource Kit
      SVG site: http://www.schemasoft.org/svg/main.svg
      HTML site: http://www.schemasoft.org/

      -----Original Message-----
      From: revelonix [mailto:raida@...]
      Sent: Montag, 2. Februar 2004 16:50
      To: svg-developers@yahoogroups.com
      Subject: [svg-developers] Re: The best way


      Yes. Thanx. I corrected some little mistakes in your code and it works
      (after second click)
      (http://www.guide.cz/svg/temp/sample2.svg)

      So solution is as I though before, encapsulate SVG into another
      element, in this case SVG too. My question is: if I'd like add
      dynamically many of objects, I need dynamically generate new SVG
      encapsulating containers... But why I'm not able directly change
      attributes of this external SVG file?

      Marek R.

      --- In svg-developers@yahoogroups.com, "Chris Peto" <CPeto@r...> wrote:
      > Hi,
      >
      > If so it is like this:
      >
      > <?xml version="1.0" encoding="UTF-8"?>
      > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
      > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
      > <!ATTLIST svg xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink">
      > ]>
      > <svg xmlns="http://www.w3.org/2000/svg"
      > xmlns:xlink="http://www.w3.org/1999/xlink">
      > <script type="text/javascript">
      > var svgdoc,context,xmldoc,ver;
      > svgdoc=document.documentElement;
      > ver=getSVGViewerVersion();
      > function LadeXML(evt, target){
      > var obj = svgdoc.getElementById(target);
      > function callback(urlRequestStatus){
      > if(urlRequestStatus.success){
      > xmldoc=parseXML(urlRequestStatus.content, context);
      > if(obj) obj.appendChild(xmldoc);
      > //svgdoc.appendChild(xmldoc);
      > }
      > }
      >
      > if(ver.indexOf("Adobe")!=-1){
      > context=evt.target.ownerDocument;
      > getURL("a.svg",callback);
      > }
      > }
      > </script>
      > <a xlink:href=""
      > onclick="LadeXML(evt,"dynamic1");LadeXML(evt,"dynamic2");"><text x="30"
      > y="80" style="fill: #00C">Load and show</text></a>
      > <svg id="dynamic1" x="200" y="200" width="100" height="100">
      > <svg id="dynamic2" x="50" y="50" width="100" height="100">
      > </svg>
      >
      > Have not tested, so not sure if everything correct. Tell me if it
      works.
      >
      > Make sure the a.svg has width="100%" height="100%" and a fixed viewbox.
      > Mit freundlichen Grüßen/Regards
      > Chris Peto
      > Freelance System Development
      > ------------------------------------
      > Resource Solutions
      > Germany
      > Mobile: +49 (0) 173 308 7843
      > Tel:+49(0) 6103 80 21 98
      > Web: http://www.resource-solutions.de
      > SVG editor: http://www.resource-solutions.de/svgeditor.html
      > mailto:CPeto@r...
      > ------------------------------------
      > Member of: SPARK - SVG Programmers' Application Resource Kit
      > SVG site: http://www.schemasoft.org/svg/main.svg
      > HTML site: http://www.schemasoft.org/
      >
      > -----Original Message-----
      > From: Chris Peto [mailto:CPeto@r...]
      > Sent: Montag, 2. Februar 2004 16:28
      > To: svg-developers@yahoogroups.com
      > Subject: RE: [svg-developers] Re: The best way
      >
      >
      > Hi,
      >
      > You do not need this. You asked to use a svg in many loads and
      have it
      > fit,
      > right?
      >
      > Mit freundlichen Grüßen/Regards
      > Chris Peto
      > Freelance System Development
      > ------------------------------------
      > Resource Solutions
      > Germany
      > Mobile: +49 (0) 173 308 7843
      > Tel:+49(0) 6103 80 21 98
      > Web: http://www.resource-solutions.de
      > SVG editor: http://www.resource-solutions.de/svgeditor.html
      > mailto:CPeto@r...
      > ------------------------------------
      > Member of: SPARK - SVG Programmers' Application Resource Kit
      > SVG site: http://www.schemasoft.org/svg/main.svg
      > HTML site: http://www.schemasoft.org/
      >
      > -----Original Message-----
      > From: revelonix [mailto:raida@a...]
      > Sent: Montag, 2. Februar 2004 16:18
      > To: svg-developers@yahoogroups.com
      > Subject: [svg-developers] Re: The best way
      >
      >
      > Sorry for my today's stupidity, but why these methods
      >
      > //// **********************************************
      > // xmldoc.setAttribute("viewBox", 50, 50, 50, 50);
      > // var xxx = xmldoc.getElementById('mainDoc');
      > //// **********************************************
      >
      > don't work at my example?
      > (http://www.guide.cz/svg/temp/sample.svg, commented now).
      >
      > I didn't perhaps understant what did you wrote to me correctly...
      >
      >
      > Marek R.
      >
      >
      > --- In svg-developers@yahoogroups.com, "Chris Peto" <CPeto@r...>
      wrote:
      > > Hi,
      > >
      > > If you want it to fit then make an svg id ="dynamic" with
      > x,y,width, and
      > > height fixed, not percentage. Then in you svg that you load:
      > >
      > > <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"
      > > viewBox="0 0 1000 1000">
      > >
      > > With viewbox set viewBox="0 0 WWWW HHHH" fixed, and width="100%"
      > > height="100%". This will cause your svg to scale to "dynamic" or
      > what id
      > > you use. Remember in asv6 you can only have fragment for
      parseXML.
      > >
      > > Mit freundlichen Grüßen/Regards
      > > Chris Peto
      > > Freelance System Development
      > > ------------------------------------
      > > Resource Solutions
      > > Germany
      > > Mobile: +49 (0) 173 308 7843
      > > Tel:+49(0) 6103 80 21 98
      > > Web: http://www.resource-solutions.de
      > > SVG editor: http://www.resource-solutions.de/svgeditor.html
      > > mailto:CPeto@r...
      > > ------------------------------------
      > > Member of: SPARK - SVG Programmers' Application Resource Kit
      > > SVG site: http://www.schemasoft.org/svg/main.svg
      > > HTML site: http://www.schemasoft.org/
      > >
      > > -----Original Message-----
      > > From: revelonix [mailto:raida@a...]
      > > Sent: Montag, 2. Februar 2004 15:28
      > > To: svg-developers@yahoogroups.com
      > > Subject: [svg-developers] Re: The best way
      > >
      > >
      > > Thanx Peto.
      > > One another question: If I wish loaded SVG use several times
      with
      > > another sizes, and its declaration is:
      > > <svg xmlns="http://www.w3.org/2000/svg" width="100%"
      height="100%"
      > > viewBox="0 0 100% 100%">
      > >
      > > , which method I could use then to affect its X, Y, WIDTH and
      > HEIGHT?
      > > setAttribute(NS) seems not working for me. Or encapsulate
      SVG object
      > > in some other with defined width, height and position?
      > >
      > > Marek R.
      > >
      > >
      > > PS: OK, I accept that image is static. What confused me is
      that I
      > read
      > > somewhere that ADOBE Viewer "currently" doesn't support animated
      > GIFs,
      > > so I though that it is planned.
      > >
      > > --- In svg-developers@yahoogroups.com, "Chris Peto" <CPeto@r...>
      > wrote:
      > > > Hi,
      > > >
      > > > Use getURL and parseXML.
      > > >
      > > > Here's an example from one of my other posts:
      > > >
      > > > Use getURL and parseXML, then appendChild to your
      "dynamic" svg.
      > > Make sure
      > > > that your appended svg has width="100%" and height="100%"
      plus a
      > > viewbox if
      > > > you want it to fit. On the "dynamic" svg use x, y, width and
      > height.
      > > >
      > > > Example assumes svgdoc:
      > > >
      > > > function DynAsyncLoader(status)
      > > > {
      > > > if(status.success) {
      > > > var dsvg = svgdoc.getElementById("dynamic");
      > > > var xml = parseXML(status.content, svgdoc);
      > > > if(dsvg) dsvg.appendChild(xml);
      > > > }
      > > > else
      > > > alert(status.content);
      > > > }
      > > > function LoadDyn(name)
      > > > {
      > > > getURL(name, DynAsyncLoader);
      > > > }
      > > >
      > > > Plus, Image take is static no js or animation.
      > > >
      > > > Mit freundlichen Grüßen/Regards
      > > > Chris Peto
      > > > Freelance System Development
      > > > ------------------------------------
      > > > Resource Solutions
      > > > Germany
      > > > Mobile: +49 (0) 173 308 7843
      > > > Tel:+49(0) 6103 80 21 98
      > > > Web: http://www.resource-solutions.de
      > > > SVG editor: http://www.resource-solutions.de/svgeditor.html
      > > > mailto:CPeto@r...
      > > > ------------------------------------
      > > > Member of: SPARK - SVG Programmers' Application Resource Kit
      > > > SVG site: http://www.schemasoft.org/svg/main.svg
      > > > HTML site: http://www.schemasoft.org/
      > > >
      > > > -----Original Message-----
      > > > From: Jérôme Tricand de la Goutte [mailto:jdelagou@l...]
      > > > Sent: Montag, 2. Februar 2004 14:30
      > > > To: svg-developers@yahoogroups.com
      > > > Subject: RE: [svg-developers] The best way
      > > >
      > > >
      > > > Hello Marek
      > > >
      > > > It look strange to me that you can't use parseXML and
      > appendNode.
      > > > If you use alert, what are the results after the getURL and
      > parseXML?
      > > > Maybe your SVG are not really proper SVG enough for parseXML
      > to work.
      > > >
      > > > Could you send an example
      > > >
      > > > Jérôme
      > > >
      > > > -----Message d'origine-----
      > > > De : revelonix [mailto:raida@a...]
      > > > Envoyé : lundi 2 février 2004 14:27
      > > > À : svg-developers@yahoogroups.com
      > > > Objet : [svg-developers] The best way
      > > >
      > > >
      > > > I'd like to ask you which is the best way to include SVG
      > inside SVG.
      > > > Situation:
      > > > I've one central file and many and many animated SVG
      images in
      > > > separated files (It is not wanted to include them into
      one big
      > file).
      > > > I'd like to choose some of them and use them, include
      > animations!.
      > > > Using parseXML and appendNode on each file is not always
      > possible (or
      > > > better I don't know how to get and read local files).
      > > > Best tags to this seems to me IMAGE and USE. But I'm
      unable to
      > open
      > > > SVG with its animations/interactivity. Only static image.
      > > > Is there any other/working solution?
      > > >
      > > > Thx,
      > > >
      > > > Marek R.
      > > >
      > > >
      > > >
      > > > -----
      > > > To unsubscribe send a message to:
      > > > svg-developers-unsubscribe@yahoogroups.com
      > > > -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:
      > > > svg-developers-unsubscribe@yahoogroups.com
      > > >
      > > > Your use of Yahoo! Groups is subject to:
      > > > http://docs.yahoo.com/info/terms/
      > > >
      > > >
      > > >
      > > >
      > > > -----
      > > > To unsubscribe send a message to:
      > > > svg-developers-unsubscribe@yahoogroups.com
      > > > -or-
      > > > visit http://groups.yahoo.com/group/svg-developers and click
      > "edit my
      > > > membership"
      > > > ----
      > > >
      > > >
      > > >
      > > >
      > >
      >
      ------------------------------------------------------------------------
      > --
      > > -=
      > > -
      > > > --
      > > > Yahoo! Groups Links
      > > >
      > > > a.. To visit your group on the web, go to:
      > > > http://groups.yahoo.com/group/svg-developers/
      > > >
      > > > b.. To unsubscribe from this group, send an email to:
      > > > svg-developers-unsubscribe@yahoogroups.com
      > > >
      > > > c.. Your use of Yahoo! Groups is subject to the Yahoo!
      Terms
      > of
      > > Service.
      > > >
      > > >
      > > >
      > > >
      > > > [Non-text portions of this message have been removed]
      > >
      > >
      > >
      > > -----
      > > To unsubscribe send a message to:
      > > svg-developers-unsubscribe@yahoogroups.com
      > > -or-
      > > visit http://groups.yahoo.com/group/svg-developers and click
      "edit
      > my
      > > membership"
      > > ----
      > >
      > >
      > > Yahoo! Groups Sponsor
      > > ADVERTISEMENT
      > >
      > >
      > >
      > >
      > >
      > >
      >
      ------------------------------------------------------------------------
      > --
      > -=
      > -
      > > --
      > > Yahoo! Groups Links
      > >
      > > a.. To visit your group on the web, go to:
      > > http://groups.yahoo.com/group/svg-developers/
      > >
      > > b.. To unsubscribe from this group, send an email to:
      > > svg-developers-unsubscribe@yahoogroups.com
      > >
      > > c.. Your use of Yahoo! Groups is subject to the Yahoo!
      Terms of
      > Service.
      > >
      > >
      > >
      > >
      > > [Non-text portions of this message have been removed]
      >
      >
      >
      > -----
      > To unsubscribe send a message to:
      > svg-developers-unsubscribe@yahoogroups.com
      > -or-
      > visit http://groups.yahoo.com/group/svg-developers and click
      "edit my
      > membership"
      > ----
      >
      >
      >
      >
      --------------------------------------------------------------------------
      > --
      > --
      > Yahoo! Groups Links
      >
      > a.. To visit your group on the web, go to:
      > http://groups.yahoo.com/group/svg-developers/
      >
      > b.. To unsubscribe from this group, send an email to:
      > svg-developers-unsubscribe@yahoogroups.com
      >
      > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > Service.
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      > -----
      > To unsubscribe send a message to:
      > svg-developers-unsubscribe@yahoogroups.com
      > -or-
      > visit http://groups.yahoo.com/group/svg-developers and click "edit my
      > membership"
      > ----
      >
      >
      > Yahoo! Groups Sponsor
      > ADVERTISEMENT
      >
      >
      >
      >
      >
      >
      --------------------------------------------------------------------------
      -=
      -
      > --
      > Yahoo! Groups Links
      >
      > a.. To visit your group on the web, go to:
      > http://groups.yahoo.com/group/svg-developers/
      >
      > b.. To unsubscribe from this group, send an email to:
      > svg-developers-unsubscribe@yahoogroups.com
      >
      > c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service.
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]



      -----
      To unsubscribe send a message to:
      svg-developers-unsubscribe@yahoogroups.com
      -or-
      visit http://groups.yahoo.com/group/svg-developers and click "edit my
      membership"
      ----


      Yahoo! Groups Sponsor
      ADVERTISEMENT





      ----------------------------------------------------------------------------
      --
      Yahoo! Groups Links

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

      b.. To unsubscribe from this group, send an email to:
      svg-developers-unsubscribe@yahoogroups.com

      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.