This is just to bother you a little more ;-) I tried with a substitution group. But for some reason it doesn't work. It maybe that the schema is not valid, but xxe says it is.
I attach the files (most of the changes are in params.xsd) in case you have more time to waste for me, but I can live with the abstract type solution you proposed, so don't worry too much about this. Thanks again Frederic 2007/4/10, Fr?d?ric Boone <fredboone at googlemail.com>: > 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 -------------- A non-text attachment was scrubbed... Name: astromodelschema.xsd Type: application/octet-stream Size: 4917 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/0efd87f0/attachment.dll -------------- next part -------------- A non-text attachment was scrubbed... Name: data.xsd Type: application/octet-stream Size: 3765 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/0efd87f0/attachment-0001.dll -------------- next part -------------- A non-text attachment was scrubbed... Name: general.xsd Type: application/octet-stream Size: 4462 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/0efd87f0/attachment-0002.dll -------------- next part -------------- A non-text attachment was scrubbed... Name: params.xsd Type: application/octet-stream Size: 3246 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/0efd87f0/attachment-0003.dll -------------- next part -------------- A non-text attachment was scrubbed... Name: astromodel.xml Type: text/xml Size: 3989 bytes Desc: not available Url : http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20070410/0efd87f0/attachment.xml

