🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.document.graphics.server
10 messages
10 total messages Started by antilles_wedge Tue, 13 Jul 2004 15:30
Add a tag in a svg file, using an xml command
#42
Author: antilles_wedge
Date: Tue, 13 Jul 2004 15:30
16 lines
979 bytes
I have a svg file like this :
<svg>
<circle ... />
</svg>

I would like to have this using an xml command :

<svg>
<circle ... />
<ellipse ... />
</svg>

I know how to modify a tag with the "set" command. But I don't know how to create a new one .

Can someone help me ?
Thanks.
Re: Add a tag in a svg file, using an xml command
#43
Author: Chuck_M
Date: Tue, 13 Jul 2004 21:00
3 lines
1053 bytes
In AGS you'll have to use the set command to modify the tag one level higher than where you want to make the addition. In your example, you'd have to do the set on the svg tag: reading in all the existing SVG, modifying it, and then doing the set.

This would be a lot easier to do in an XML parser (Xerces, etc.) than AGS.
Re: Add a tag in a svg file, using an xml command
#46
Author: antilles_wedge
Date: Thu, 15 Jul 2004 09:28
6 lines
859 bytes
Thanks.

But I'd like to know if a command to create a tag exist in ADS ?
I'd like to start with an empty svg, and then add elements with ADS.

Wedge
Re: Add a tag in a svg file, using an xml command
#48
Author: Wilson_Lei
Date: Thu, 15 Jul 2004 17:45
1 lines
858 bytes
If you know the syntax and structure of the SVG file you want, and will start from scratch. Why use ADS? You could just create a text file name it with .svg extension. I am confused.
Re: Add a tag in a svg file, using an xml command
#67
Author: antilles_wedge
Date: Wed, 21 Jul 2004 13:07
16 lines
1237 bytes
I try ADS for making demo.
I would like to know if ADS is able to do what i need.
In fac, I don't really start from scratch. I have this, in an other example, still in SVG :

<_text id="texte" font-family="'CopperplateGothicBT-Roman'" font-size="9" x=" 171.6914" y="62.5059" >
       _my_text_
 <_/text>

And I would like to change "_my_text_". I have try differents Xpath, but it'n doesn't work (i loose the attributs, or the text doesn't change). I have try this for example:

<set target="id('new')">_change_</set>
but i loose the attributs.

Why it doesn't work ??

Thanks
Re: Add a tag in a svg file, using an xml command
#70
Author: Bob_Emerson
Date: Wed, 21 Jul 2004 17:03
6 lines
1092 bytes
See the documentation for the set command in the Command Reference. It has a section with a few "set" examples for simple SVG.

This will work to replace a simple run of existing text at the "top" level of the SVG.
set target="/svg/text[@id='texte']/node()" value="new text"

If you want to replace text in SVG, you should look at the applyVariables command in both the Command Reference and the Developer Guide. That takes away the hassle of dealing with xPaths.
Re: Add a tag in a svg file, using an xml command
#73
Author: antilles_wedge
Date: Thu, 22 Jul 2004 07:53
3 lines
745 bytes
Thanks Bob, it works !
I use the node() command, and it's correct
Thanks again.
Re: Add a tag in a svg file, using an xml command
#72
Author: antilles_wedge
Date: Thu, 22 Jul 2004 08:05
14 lines
1101 bytes
But I still have the problem of creating a new tag. The set command can modify a tag. But is there a way to create a new one ?

<svg>
<circle ... />
</svg>

I would like to have this using an xml command :

<svg>
<circle ... />
<ellipse ... />
</svg>

With the set & node commands I can create only one tag inside the circle tag. But it's not what I want. I need to create one just after..
Re: Add a tag in a svg file, using an xml command
#75
Author: Bob_Emerson
Date: Thu, 22 Jul 2004 15:23
30 lines
1364 bytes
See the earlier responses from Chuck and Wilson for two options.

To make it a little easier to use AGS's set command to replace the outer tag, write your SVG with one or more <g> tags

<svg>
<g>
<circle ... />
</g>
... other stuff
</svg>

Then replace the old <g> with just the circle with the new one that has both the circle and the ellipse. (The logic and code to do this would have to happen outside of AGS.)

<svg>
<g>
<circle ... />
<ellipse ... />
</g>
... other stuff
</svg>

Or something like this might work with predefined placeholders :
<svg>
<g id="circle" >
<circle ... />
<g id="empty1"></g>
<g id="empty2"></g>
</svg>

Then you can replace the empty g's...
Re: Add a tag in a svg file, using an xml command
#76
Author: antilles_wedge
Date: Thu, 22 Jul 2004 15:35
2 lines
846 bytes
Thanks. It's what I do. I create my svg with a lot of empty tag cause I don't know how I will need. So it seems that there is no command to create a new tag.
Thanks for all of that.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads