The rationale is:
If you want to specify a unique ID (moreover, a unique ID which is
consistent in its syntax with other unique IDs found in the document),
you really need to display the list of other unique IDs found in the
document.

In practice, (IMHO) this way of doing this (and especially the
auto-completion feature, even for choosing a unique ID) works very well.

Now this being said, we'll try to improve the putAttribute dialog box in
next release. It should not allow specifying an ID which is already in
use by another element.

Kevin Flynn wrote:
> Is the behavior of XmlMind's putAttribute function sensible for
> attributes of type ID? If no value is specified, then a select box
> dialog is displayed that allows you to select from a list of existing ID
> values. This is obviously the correct behavior for IDREF attributes, but
> surely the point when inserting an ID attribute is to insert a
> unique value that has not yet been used?
>  
> I am currently using version 3.0 of XmlMind.
>  
> Do you have a workaround that lets me display a standard "prompt" dialog
> for a newly inserted element only if it has an attribute called "id"? I
> tried this, but it doesn't seem to work, for reasons I don't understand:
>  
>   <cfg:command name="my.insert">
>     <cfg:macro trace="true">
>       <cfg:sequence>
>         <cfg:command name="insert" parameter="%0" />
>         <cfg:choice>
>           <cfg:sequence>
>             <cfg:match context="$selectedElement" pattern="@id"/>
>             <cfg:command name="prompt" parameter="'Insert Element'
> 'Enter element ID:'" />
>             <cfg:command name="putAttribute"
> parameter="[implicitElement] id '%_'" />
>           </cfg:sequence>
>         </cfg:choice>
>       </cfg:sequence>
>     </cfg:macro>
>   </cfg:command>
>  

Reply via email to