Generating an ID for a topic/concept/task/etc...and DITA map
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 2
- Joined: Fri Mar 26, 2010 7:57 pm
Generating an ID for a topic/concept/task/etc...and DITA map
Firstly - I am brand new to using Oxygen. We are converting from FrameMaker.
We will use a concept as the example, but this applies to maps, references and tasks as well:
When creating a DITA concept I need to automatically generate the id at the topic level (do not want to remember to right click on the element and generate id because people never remember). I have found where I can auto generate for some of the lower level elements contained with the concept, but the concept level generates with the id assigned in the template - which is NOT unique. Maps generate with no id at all.
How do I do this? Thanks for your patience with a newb.
We will use a concept as the example, but this applies to maps, references and tasks as well:
When creating a DITA concept I need to automatically generate the id at the topic level (do not want to remember to right click on the element and generate id because people never remember). I have found where I can auto generate for some of the lower level elements contained with the concept, but the concept level generates with the id assigned in the template - which is NOT unique. Maps generate with no id at all.
How do I do this? Thanks for your patience with a newb.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Generating an ID for a topic/concept/task/etc...and DITA map
Hi,
The New Templates in Oxygen are actually XML files saved in the associated Document Types directories.
If in those XML files you use known Oxygen editor variables, they will get expanded when the file gets created to their specific value.
For example if I edit in the
OXYGEN_INSTALL_DIR/frameworks/dita/templates/topic/Topic.xml template and set its id value like:
The file template will show a validation error but when a new topic gets created from the template its id value will be unique (in this case the current system time in milliseconds).
Another editor variable which you can use is:
${date(yyyy-MM-dd)}
The pattern in the date can be very flexible, see this link:
http://java.sun.com/j2se/1.4.2/docs/api ... ormat.html
Templates for DITA Map are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\map
Templates for DITA Topics are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\topic
Hope this helps,
Regards,
Radu
The New Templates in Oxygen are actually XML files saved in the associated Document Types directories.
If in those XML files you use known Oxygen editor variables, they will get expanded when the file gets created to their specific value.
For example if I edit in the
OXYGEN_INSTALL_DIR/frameworks/dita/templates/topic/Topic.xml template and set its id value like:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN"
"http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd">
<topic id="topic_${timeStamp}">
<title>Topic title</title>
<body>
<p>Topic paragraph</p>
</body>
</topic>
Another editor variable which you can use is:
${date(yyyy-MM-dd)}
The pattern in the date can be very flexible, see this link:
http://java.sun.com/j2se/1.4.2/docs/api ... ormat.html
Templates for DITA Map are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\map
Templates for DITA Topics are saved here:
OXYGEN_INSTALL_DIR\frameworks\dita\templates\topic
Hope this helps,
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service