Automatic population of xs:id attributes

Having trouble installing Oxygen? Got a bug to report? Post it all here.
MaNI
Posts: 10
Joined: Mon Sep 21, 2015 9:52 pm

Automatic population of xs:id attributes

Post by MaNI »

Hello,

Is there some way to configure oXygen to auto populate a specific xs:id attribute when new nodes are added to the document? (For regular XML not DITA, TEI, docbook...)

I've been searching but can't find anything - it seems that for DITA etc. there are ways to set it but I don't understand why this would be DITA specific?
Radu
Posts: 9449
Joined: Fri Jul 09, 2004 5:18 pm

Re: Automatic population of xs:id attributes

Post by Radu »

Hi,

Are you editing the custom XML document in the Text or in the Author editing mode?

Indeed right now we have automatic ID generation only for some vocabularies which are bundled with Oxygen like DITA or Docbook. And this only works in the Author editing mode.
Maybe the easiest way for you to do this would be to define a new code template in the Oxygen Preferences->Editor / Templates / Code Templates page which would insert something like:

Code: Select all

<tagName id="${id}"></tagName>
In the Text editing mode you can press CTRL-SPACE to show all code templates and the code template will be automatically expanded on insertion.
In the Author editing mode you can press ENTER and the code template should also be present there.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply