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

Re: [svg-developers] Access to the objects in an embedded SVG

Expand Messages
  • Christophe Barbier
    paulroubekas and Jérôme, Thank you for your answers. Jérôme guessed right, that s approximatively the way I work, but the used SVG file is external. (I
    Message 1 of 4 , Apr 30, 2004
    • 0 Attachment
      paulroubekas and Jérôme,

      Thank you for your answers.
      Jérôme guessed right, that's approximatively the way I work, but the "used" SVG file is external.
      (I use ASV6)

      I wanted to switch the visibility of groups <g> in my external SVG from my master SVG.
      It looks like it is impossible.


      I know, I could use parseXML instead but I faced other problems.
      I had to remove the french caracters, the <?xml> and <!DOCTYPE> tags in the embedded SVG.
      (Jérôme and Chris Peto had helped me a long time on this thread).


      Anyway, Thanks again,
      __________________________________________________
      Christophe Barbier, I2G
      Division Système
      christophe.barbier@...
      Tel: 03.20.65.03.44
      Fax: 03.20.65.07.76
      Parc des Rouges Barres
      Marcq-en-Baroeul 59700

      ----- Original Message -----
      From: Jérôme Tricand de la Goutte
      To: svg-developers@yahoogroups.com
      Sent: Friday, April 30, 2004 3:18 PM
      Subject: Re: [svg-developers] Access to the objects in an embedded SVG


      Salut Chritophe

      Could you send us the svg code.

      But I can already tell you that getElementById is not a method for <use> element.

      I guess you have something like:
      <defs>
      <g id='toto'>
      <rect id="parcel" x="" ... />
      <rect id="titi ... />
      </g>
      </defs>
      <use id="MapLink" xlink:href="#toto"/>
      <use id="MapLink2" xlink:href="#toto"/>

      You can't have "parcel" displayed using "MapLink2" and not using "MapLink" : Imagine that "toto" is a symbol. It is the same in ALL your SVG document.
      You can only change the way it should be drawed when you need it, ie in the <use> element.

      So you should create two symbols called "parcel" and "titi" then use them in the rest of your code. That way, you will be able to display independently

      Christophe Barbier wrote:

      > Hi,
      >
      > I have a SVG that embeds another one through a <use> tag.
      >
      > Does anybody know if I can access to the different objects contained in my embedded SVG object ?
      >
      > Here is what I do:
      >
      > --------------------------------------------------------------------------------
      >
      > svgDoc = evt.getTarget().getOwnerDocument();
      >
      > var refSVG = svgDoc.getElementById("MapLink");
      >
      > refSVG.getElementById("Parcels").getStyle().setProperty("display", "none");
      >
      > --------------------------------------------------------------------------------
      >
      > The last line sends an error.
      >
      > I would appreciate any help.
      > Thanks,
      >
      > __________________________________________________
      > Christophe Barbier, I2G
      > Division Système
      > christophe.barbier@...
      > Tel: 03.20.65.03.44
      > Fax: 03.20.65.07.76
      > Parc des Rouges Barres
      > Marcq-en-Baroeul 59700
      >
      > [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
      >
      >
      >
      >



      -----
      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]
    Your message has been successfully submitted and would be delivered to recipients shortly.