Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: SVG DOM >Thread Next - Re: SVG DOM Re: SVG DOMTo: NULL Date: 9/30/2009 8:51:00 PM > It seems the intended way to reuse LINQ to XML classes is the annotation
> feature:
> http://blogs.msdn.com/mikechampion/archive/2006/08/17/705278.aspx
This seems fine enough. And possibility to "inject methods" through
extensions seems very helpful as well (an example shown in
http://blogs.msdn.com/mikechampion/archive/2006/09/10/748408.aspx).
However after few small code experiments I came to a conclusion that it
might not be enough. I considered adding classes with SVG DOM-like
properties as annotations to the XElements. An example is the base IDL
SVGElement which contains attributes "id" and "xmlbase" (referring to "id"
element attribute and "xml:base" element attribute). I changed it to an
SvgElement class with Id and XmlBase properties. But then natural question
occurs: should those be get only or get/set? In the IDL's SVGElement they
are get/set (with some restrictions). If I was to support the setting how
would I do that? I considered constructing my SvgElement with XElement (to
which it referrers) given during construction and not only reading
appropriate data but also storing the XElement to be able latter to set the
data in setters.
All fine but what if the user copies XElement? The annotation is not
copied. (And even if I would find a way to copy it it would still be
incorrect as internal XElement reference would be to the original XElement.)
Also if user adds a new XElement to the tree I have very poor means to
detect it to be able to add appropriate annotation.
Do you have any suggestions to work around this?
Adam Badura
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
