XML Elves

XML Elves

<community>of XML and SVG Developers</community>


SVG in SVG (also with own attributes)

This is a discussion on SVG in SVG (also with own attributes) within the SVG Questions forums, part of the SVG Forums category; Hello Does anybody know a way to use a SVG in a other SVG? I know only this way: HTML ...


Go Back   XML Elves > SVG Forums > SVG Questions

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2009, 09:15 AM
Junior Member
 
Join Date: May 2009
Posts: 1
Default SVG in SVG (also with own attributes)

Hello

Does anybody know a way to use a SVG in a other SVG?

I know only this way:
HTML Code:
<?xml version="1.0" encoding="UTF-8"?>
<svg 
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    viewBox = "0 0 1000 1000" version = "1.1">
    <defs>
        <svg id="MySvg" width="5cm" height="5cm" version="1.1" xmlns="http://www.w3.org/2000/svg" testAttrib = "value on startup">
          <g id="group2" fill="blue" >
            <rect x="1cm" y="3cm" width="1cm" height="1cm" />
            <rect x="3cm" y="3cm" width="1cm" height="1cm" />
          </g>
        </svg>
    </defs>
    <use x="10" y="100" xlink:href="#MySvg" testAttrib = "value after change"/>
</svg> 
But this only works if the other svg is in the same file.
Normally the link must also works with:
HTML Code:
<use x="10" y="100" xlink:href="otherfile.svg#MySvg" testAttrib = "value after change"/> 
But it does not work.

A other question is, how to define own attribute (e.g.: testAttrib) in the source-svg, redefine it in the use-svg and use/check it in the source-svg.
The way above in my code does not work.

Thanks for solutions and ideas.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
attributes, svg


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -6. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2

DATA RECOVERY
Send your hard disk drive to Data Clinic for prompt data recovery.


1 2 3 4 5 6 7 8 9 10 11