This content has been marked as final. Show 4 replies
If you try it in the UI, you'll see that when only an insertion point is selected and you try to tag it, the whole story is tagged.
I don't think that what you're trying can be done. You have to tag content, not the lack of it. However, what you could do is insert some temporary text at the insertion point, tag that and then delete the text. That will have the effect you're trying to achieve.
...but you can enter a character in the contents of the insertion point, tag it, and then delete the character. This creates an empty element at the insertion point. Not elegant, but it works.:-)
gui testing is always a good idea :-) but in this case the behaviour is different:
your observation is correct (anyway at least a strange behaviour compared to any xml editing tool i know == how adobe intended to insert an empty element?), tagging in the gui a tagged insertion point tags the whole story.
in the script a new element is added but the return value is the parent element (the xmlElement of the whole story).
this causes a problem when i add an attribute (the intention of the above script is to add references) which is added to the parent element.
maybe i'm not firm with insertion points, but your solution does not work:
_insert = erg.insertionPoints;
_insert.contents = "i";
_xml = dokument.xmlElements.xmlElements.item("text").xmlElements.add(_dokument.xmlTags.item(" index") , _insert );
leads to the following xml structure: foo
i foo and the same behaviour as in the reply to dave encounters (return value = parent element)
do i use the contents attribute correct?