<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BwyDpf</id>
	<title>Inkscape Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.inkscape.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=BwyDpf"/>
	<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/Special:Contributions/BwyDpf"/>
	<updated>2026-04-15T22:26:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki.inkscape.org/wiki/index.php?title=AST&amp;diff=14108</id>
		<title>AST</title>
		<link rel="alternate" type="text/html" href="https://wiki.inkscape.org/wiki/index.php?title=AST&amp;diff=14108"/>
		<updated>2007-04-11T09:29:38Z</updated>

		<summary type="html">&lt;p&gt;BwyDpf: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here's a concrete example of what I have in mind.  Take the following&lt;br /&gt;
SVG fragment:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;g&amp;gt;&lt;br /&gt;
   &amp;lt;rect x=&amp;quot;0&amp;quot; y=&amp;quot;0&amp;quot; width=&amp;quot;100&amp;quot; height=&amp;quot;100&amp;quot;&lt;br /&gt;
    style=&amp;quot;fill:red;stroke:black&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;use xlink:href=&amp;quot;#foo&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/g&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AST would look something like this:&lt;br /&gt;
&lt;br /&gt;
Key: [1] - numbered continuation points so the diagram won't wrap&lt;br /&gt;
     (ClassName) - a mutable node of a given class&lt;br /&gt;
     &amp;quot;blah&amp;quot; - an immutable string node&lt;br /&gt;
     ( &amp;quot;axis&amp;quot;, &amp;quot;name&amp;quot; ) - a branch name (a branch can hold one or&lt;br /&gt;
                          more children)&lt;br /&gt;
     {SVG}g - shorthand for an expanded name in the SVG namespace&lt;br /&gt;
&lt;br /&gt;
 (XMLElement)-- -- ( &amp;quot;name&amp;quot;, NULL ) -- &amp;quot;{SVG}g&amp;quot;&lt;br /&gt;
               |&lt;br /&gt;
                -- ( &amp;quot;child&amp;quot;, NULL ) -- [1]&lt;br /&gt;
                                        [2]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 [1](XMLElement)-- -- ( &amp;quot;name&amp;quot;, NULL ) -- &amp;quot;{SVG}rect&amp;quot;&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;x&amp;quot; ) -- &amp;quot;0&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;y&amp;quot; ) -- &amp;quot;0&amp;quot;&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;width&amp;quot; ) -- &amp;quot;100&amp;quot;&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;height&amp;quot; ) -- &amp;quot;100&amp;quot;&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;style&amp;quot; ) -- [3]&lt;br /&gt;
&lt;br /&gt;
 [2](XMLElement)-- -- ( &amp;quot;name&amp;quot;, NULL ) -- &amp;quot;{SVG}use&amp;quot;&lt;br /&gt;
                  |&lt;br /&gt;
                   -- ( &amp;quot;attribute&amp;quot;, &amp;quot;{XLINK}href&amp;quot; ) -- &amp;quot;#foo&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 [3](CSSDeclList)-- -- ( &amp;quot;child&amp;quot;, NULL ) -- [4]&lt;br /&gt;
                                            [5]&lt;br /&gt;
&lt;br /&gt;
 [4](CSSProperty)-- -- ( &amp;quot;name&amp;quot;, NULL ) -- &amp;quot;fill&amp;quot;&lt;br /&gt;
                   |&lt;br /&gt;
                    -- ( &amp;quot;value&amp;quot;, NULL ) -- &amp;quot;red&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 [5](CSSProperty)-- -- ( &amp;quot;name&amp;quot;, NULL ) -- &amp;quot;stroke&amp;quot;&lt;br /&gt;
                   |&lt;br /&gt;
                    -- ( &amp;quot;value&amp;quot;, NULL ) -- &amp;quot;black&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The leaf nodes are immutable strings, so all mutations of the tree are&lt;br /&gt;
accomplished by adding/reordering/exchanging/removing nodes on branches.&lt;br /&gt;
&lt;br /&gt;
Depending on the class of a node (and on higher-level objects which have&lt;br /&gt;
attached themselves to it), various constraints may be applied as to&lt;br /&gt;
which mutations are valid and permitted.  Every mutation also results in&lt;br /&gt;
a notification to any interested listeners, on a per-node basis.&lt;br /&gt;
&lt;br /&gt;
[ For example, XML elements have only one &amp;quot;name&amp;quot;, which cannot be&lt;br /&gt;
changed, &amp;quot;attribute&amp;quot;s, and &amp;quot;child&amp;quot;ren -- no other branches are valid.&lt;br /&gt;
Their &amp;quot;child&amp;quot; axis will only accept other XMLElements, and branches on&lt;br /&gt;
the &amp;quot;attribute&amp;quot; axis will only accept one child.  This permits the&lt;br /&gt;
actual representation for XMLElements to be very compact and&lt;br /&gt;
specialized. ]&lt;br /&gt;
&lt;br /&gt;
Every node is capable of serializing itself as a UTF-8 string, and every&lt;br /&gt;
class has an associated parser (here generally implemented using libxml&lt;br /&gt;
or libcroco) that can be used to build nodes of that class from such a&lt;br /&gt;
string.&lt;br /&gt;
&lt;br /&gt;
What is this? Please explain&lt;br /&gt;
[[Category:Needs Work]]&lt;/div&gt;</summary>
		<author><name>BwyDpf</name></author>
	</entry>
</feed>