In C#, how can I design an object that mirrors the SVG protocol -


i'm building rough implementation of of basic svg elements. i'd serialize object usable xml stream. of details i'm ok with, reason, i'm getting stuck on basics of type of object ("g) can contain 1 or more of same type of objects.

here's stripped down example:

<svg>   <g display="inline">     <g display="inline">         <circle id="mycircle1"/>         <rectangle id="myrectangle1"/>     </g>     <circle id="mycircle2"/>     <rectangle id="myrectangle2"/>   </g> </svg> 

the first 'g' element contains other g elements. what's best way design object?

[xmltypeof("svg")] public class svg {     public graphicgroup g {set; get;} }  public graphicgroup {    public graphicgroup g {set; get;}    public circle circle { set; get;}    public rectangle rectangle { set; get;} }  public circle... public rectangle... 

this isn't quite right, or not close. ideas?

use xsd , xsd code generators


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -