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

embeeding svg into svg not shows anything

Expand Messages
  • William Castro G.
    Please help me, I m trying to embeed a SVG2 into SVG1 when Load events occurs in SVG1: It doesn t report any exception, but doesn t show anything either. �It s
    Message 1 of 6 , Feb 28, 2003
      Please help me,

      I'm trying to embeed a SVG2 into SVG1 when Load events occurs in SVG1:
      It doesn't report any exception, but doesn't show anything either.
      ¿It's correct what I'm doing, Is it possible?

      Thank in advance,
      Bill.

      My Codes are:

      ******************************************************
      SVG1.svg Code:
      ******************************************************

      <?xml version="1.0"?>
      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
      "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">

      <svg width="476" height="433" onload="svg_OnLoad(evt)">
      <script><![CDATA[
      function svg_OnLoad(evt) {
      var svgDoc;
      var img;
      var i;

      svgDoc = evt.getTarget().getOwnerDocument();
      img = svgDoc.createElement("image");
      img.setAttribute("x", 0);
      img.setAttribute("y", 0);
      img.setAttribute("width", 200);
      img.setAttribute("height", 200);
      img.setAttribute("xlink:href", "svg2.svg");
      svgDoc.getElementsByTagName("svg").item(0).appendChild(img);

      }
      ]]></script>
      </svg>

      ******************************************************
      SVG2.svg Code:
      ******************************************************
      <?xml version="1.0"?>
      <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
      "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
      <svg x= "0" y = "0" width="200" height="200" viewBox = "0 0 200 200" >
      <path
      d="M0 10 L0 24 L200 24 L200 12 L200 12 C200 5.37258
      194.627 0 188 0 C187.172 0 186.363
      0.0839466 188 0 L12 0 C4.11338 1.36275 0 6.20101
      0 12 z"

      style="fill:rgb(255,255,255);stroke:rgb(128,128,128);stroke-width:1"/>
      <path
      d="M0 24 L0 188 L0 188 C0 194.627 5.37258 200 12 200 L188
      200 L188 200 C194.627 200
      200 194.627 200 188 L200 24 z"

      style="fill:rgb(205,220,237);stroke:rgb(128,128,128);stroke-width:1"/>
      <ellipse cx="188" cy="12" rx="8" ry="8"

      style="stroke:rgb(128,128,128);stroke-width:1;fill:none"/>
      </svg>




      [Non-text portions of this message have been removed]
    • nrissvg <jnehring@state.mt.us>
      It seems to me that you would just use: svgDoc.appendChild(img); or if you want it to appear in a particular section of the SVG DOM, instantiate another
      Message 2 of 6 , Feb 28, 2003
        It seems to me that you would just use:

        svgDoc.appendChild(img);

        or if you want it to appear in a particular section of the SVG DOM,
        instantiate another element that is already in the document:

        svgRasterLayer = svgDoc.getElementById('rasterLayer'); // The
        raster layer

        svgRasterLayer.appendChild(img);

        Jon


        --- In svg-developers@yahoogroups.com, "William Castro G."
        <wcastro@l...> wrote:
        > Please help me,
        >
        > I'm trying to embeed a SVG2 into SVG1 when Load events occurs in
        SVG1:
        > It doesn't report any exception, but doesn't show anything either.
        > ¿It's correct what I'm doing, Is it possible?
        >
        > Thank in advance,
        > Bill.
        >
        > My Codes are:
        >
        > ******************************************************
        > SVG1.svg Code:
        > ******************************************************
        >
        > <?xml version="1.0"?>
        > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
        > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
        >
        > <svg width="476" height="433" onload="svg_OnLoad(evt)">
        > <script><![CDATA[
        > function svg_OnLoad(evt) {
        > var svgDoc;
        > var img;
        > var i;
        >
        > svgDoc = evt.getTarget().getOwnerDocument();
        > img = svgDoc.createElement("image");
        > img.setAttribute("x", 0);
        > img.setAttribute("y", 0);
        > img.setAttribute("width", 200);
        > img.setAttribute("height", 200);
        > img.setAttribute("xlink:href", "svg2.svg");
        > svgDoc.getElementsByTagName("svg").item(0).appendChild
        (img);
        >
        > }
        > ]]></script>
        > </svg>
        >
        > ******************************************************
        > SVG2.svg Code:
        > ******************************************************
        > <?xml version="1.0"?>
        > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
        > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
        > <svg x= "0" y = "0" width="200" height="200" viewBox = "0 0 200
        200" >
        > <path
        > d="M0 10 L0 24 L200 24 L200 12 L200 12 C200
        5.37258
        > 194.627 0 188 0 C187.172 0 186.363
        > 0.0839466 188 0 L12 0 C4.11338 1.36275
        0 6.20101
        > 0 12 z"
        >
        > style="fill:rgb(255,255,255);stroke:rgb(128,128,128);stroke-
        width:1"/>
        > <path
        > d="M0 24 L0 188 L0 188 C0 194.627 5.37258 200 12
        200 L188
        > 200 L188 200 C194.627 200
        > 200 194.627 200 188 L200 24 z"
        >
        > style="fill:rgb(205,220,237);stroke:rgb(128,128,128);stroke-
        width:1"/>
        > <ellipse cx="188" cy="12" rx="8" ry="8"
        >
        > style="stroke:rgb(128,128,128);stroke-width:1;fill:none"/>
        > </svg>
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
      • Chris Peto
        Hi, You have to use setAttrubuteNS for xlink to see the image I believe, plus you need to append the new element to document root: svgDoc =
        Message 3 of 6 , Feb 28, 2003
          Hi,

          You have to use setAttrubuteNS for xlink to see the image I believe, plus
          you need to append the new element to document root:

          svgDoc = evt.getTarget().getOwnerDocument();
          var g_root = svgDoc.getDocumentElement();

          g_pallete = g_svgdoc.createElement("image")

          g_pallete.setAttribute("id", "Pallete")
          g_pallete.setAttribute("width", "100")
          g_pallete.setAttribute("height", "200")
          g_pallete.setAttributeNS(
          'http://www.w3.org/1999/xlink/namespace/',
          'xlink:href',
          'Pallete.svg');

          g_root.appendChild(g_palette);

          Mit freundlichen Grüßen/Regards
          Chris Peto
          System Development
          ------------------------------------
          Resource Solutions
          Höhenweg 34
          63303 Dreieich - Götzenhain
          Germany
          Mobile: +49 (0) 173 308 7843
          Tel:+49(0) 6103 80 21 98
          Web: http://www.resource-solutions.de
          mailto:CPeto@...




          -----Original Message-----
          From: nrissvg <jnehring@...> [mailto:jnehring@...]
          Sent: Freitag, 28. Februar 2003 17:59
          To: svg-developers@yahoogroups.com
          Subject: [svg-developers] Re: embeeding svg into svg not shows anything


          It seems to me that you would just use:

          svgDoc.appendChild(img);

          or if you want it to appear in a particular section of the SVG DOM,
          instantiate another element that is already in the document:

          svgRasterLayer = svgDoc.getElementById('rasterLayer'); // The
          raster layer

          svgRasterLayer.appendChild(img);

          Jon


          --- In svg-developers@yahoogroups.com, "William Castro G."
          <wcastro@l...> wrote:
          > Please help me,
          >
          > I'm trying to embeed a SVG2 into SVG1 when Load events occurs in
          SVG1:
          > It doesn't report any exception, but doesn't show anything either.
          > ¿It's correct what I'm doing, Is it possible?
          >
          > Thank in advance,
          > Bill.
          >
          > My Codes are:
          >
          > ******************************************************
          > SVG1.svg Code:
          > ******************************************************
          >
          > <?xml version="1.0"?>
          > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
          > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
          >
          > <svg width="476" height="433" onload="svg_OnLoad(evt)">
          > <script><![CDATA[
          > function svg_OnLoad(evt) {
          > var svgDoc;
          > var img;
          > var i;
          >
          > svgDoc = evt.getTarget().getOwnerDocument();
          > img = svgDoc.createElement("image");
          > img.setAttribute("x", 0);
          > img.setAttribute("y", 0);
          > img.setAttribute("width", 200);
          > img.setAttribute("height", 200);
          > img.setAttribute("xlink:href", "svg2.svg");
          > svgDoc.getElementsByTagName("svg").item(0).appendChild
          (img);
          >
          > }
          > ]]></script>
          > </svg>
          >
          > ******************************************************
          > SVG2.svg Code:
          > ******************************************************
          > <?xml version="1.0"?>
          > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
          > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
          > <svg x= "0" y = "0" width="200" height="200" viewBox = "0 0 200
          200" >
          > <path
          > d="M0 10 L0 24 L200 24 L200 12 L200 12 C200
          5.37258
          > 194.627 0 188 0 C187.172 0 186.363
          > 0.0839466 188 0 L12 0 C4.11338 1.36275
          0 6.20101
          > 0 12 z"
          >
          > style="fill:rgb(255,255,255);stroke:rgb(128,128,128);stroke-
          width:1"/>
          > <path
          > d="M0 24 L0 188 L0 188 C0 194.627 5.37258 200 12
          200 L188
          > 200 L188 200 C194.627 200
          > 200 194.627 200 188 L200 24 z"
          >
          > style="fill:rgb(205,220,237);stroke:rgb(128,128,128);stroke-
          width:1"/>
          > <ellipse cx="188" cy="12" rx="8" ry="8"
          >
          > style="stroke:rgb(128,128,128);stroke-width:1;fill:none"/>
          > </svg>
          >
          >
          >
          >
          > [Non-text portions of this message have been removed]


          Yahoo! Groups Sponsor
          ADVERTISEMENT




          -----
          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"
          ----

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


          [Non-text portions of this message have been removed]
        • iceman_7012002 <iceman_7012002@yahoo.com>
          to embed one SVG into another SVG:-
          Message 4 of 6 , Feb 28, 2003
            to embed one SVG into another SVG:-

            <SVG id="First">
            <SVG id="Second">
            </SVG>
            </SVG>
          • iceman_7012002 <iceman_7012002@yahoo.com>
            to embed one SVG into another SVG:-
            Message 5 of 6 , Feb 28, 2003
              to embed one SVG into another SVG:-

              <SVG id="First">
              <SVG id="Second">
              </SVG>
              </SVG>
            • Tobias Reif
              ... The is no element SVG in SVG; using it in an SVG would make that document invalid. Use svg . Tobi -- http://www.pinkjuice.com/
              Message 6 of 6 , Mar 1, 2003
                iceman_7012002 wrote:

                > to embed one SVG into another SVG:-
                >
                > <SVG id="First">
                > <SVG id="Second">
                > </SVG>
                > </SVG>


                The is no element "SVG" in SVG; using it in an SVG would make that
                document invalid. Use "svg".


                Tobi

                --
                http://www.pinkjuice.com/
              Your message has been successfully submitted and would be delivered to recipients shortly.