Thanks a lot! you definetly solved my problem! I will consider changing the schema and use a substitution group, but I am afraid this will imply many changes in my application.
Best regards, Frederic. 2007/4/10, Hussein Shafie <hussein at xmlmind.com>: > > Fr?d?ric Boone wrote: > > OK I realize my question was not very clear. > > Here is the way I proceed (maybe this is not the right way): > > > > * I created a addon directory in .xxe/addon called "astromodel". I > > attach a zip of this directory if you want to try by yourself. > > > > * I open XXE > > > > * I go to new-->astromodel-->template > > > > * then I get the styled editor corresponding to the xmldata.css that > > you gave me (in fact astromodel.css is just a copy) > > > > * at the end of the editor there is a param with xsi:type=ParamFloat > > > > * Now to add a new parameter after this one I click on the icon at the > > top of the top right window called "Edit" or at the +> icon in this > > parameter. > > > > * Clicking on one of these icons opens a menu with only one choice, > > namely "param" > > > > Now what I would like when I click on one of these icons is a menu with > > ParamFloat > > ParamInt etc... > > and param should not appear in this menu. > > > > You have declared element "param" to be of the "ParamType" type, which > is an abstract type. Therefore, when you insert a "param" element in > XXE, it inserts an unusable, invalid, "param" element. > > In order to make the newly inserted "param" element usable one needs to: > [1] Specify an xsi:type attribute by hand using the Attribute tool. > [2] Let's say that xsi:type="ParamInt". Then you need to insert by hand > a "default" child element in order to fix the validity of the newly > inserted "param" element. > > Very tedious indeed. However there is no bug here: XXE works as expected. > > Given your schema, the only way to improve things, is to define several > "param" *element* *templates* (see > > http://www.xmlmind.com/xmleditor/_distrib/doc/configure/elementTemplate.html > ), > each "param" element template having its one xsi:type and a valid content. > > See in attached XXE configuration file: > --- > <cfg:elementTemplate name="float"> > <param xmlns="astromodelns" xsi:type="ParamFloat"> > <name></name> > <varName></varName> > <unit></unit> > <description></description> > <default>0</default> > </param> > </cfg:elementTemplate> > > <cfg:elementTemplate name="int"> > <param xmlns="astromodelns" xsi:type="ParamInt"> > <name></name> > <varName></varName> > <unit></unit> > <description></description> > <default>0</default> > </param> > </cfg:elementTemplate> > > <cfg:elementTemplate name="string"> > <param xmlns="astromodelns" xsi:type="ParamString"> > <name></name> > <varName></varName> > <unit></unit> > <description></description> > <default></default> > </param> > </cfg:elementTemplate> > > <cfg:elementTemplate name="coor"> > <param xmlns="astromodelns" xsi:type="ParamCoor"> > <name></name> > <varName></varName> > <unit></unit> > <description></description> > <default>00:00:00</default> > </param> > </cfg:elementTemplate> > --- > [[[NOTE: Add attribute selectable="override" to the first > cfg:elementTemplate after XXE v3.6 is released. A bug prevents custom > element templates having an xsi:type attribute and intended to replace > the default, automatically generated, element template, from working in > v3.5.2.]]] > > Alternatively, you may consider changing your schema and defining a > substitution group containing several param elements "intparam", > "floatparam", "stringparam", etc. Let's say that substitution groups are > much more XXE friendly than xsi:type attributes (truly one of the W3C > XML Schema horrors). > > > --- > PS: > Remainder: as of XXE v3.6, support requests related to configuring XXE > will be reserved to Professional Edition customers. More information in > http://www.xmlmind.com/xmleditor/std_to_perso.html > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/5d0e175e/attachment.htm

