Changing default attribute values
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 2
- Joined: Sat Oct 18, 2008 12:05 am
Changing default attribute values
Post by ericlandes »
My specific problem is this:
I'd like to have the editor (using 9.3) automatically fill in the outputclass attribute to "stdimage" whenever I add an image to a DITA file. Our style guide requires a certain spacing around images, and the best way I've found to support that is through custom CSS. I'd like to make this brainless and thus change the default attribute value to our CSS class. I'd also like to change the default value of the placement attribute to be "break" as well for similar reasons.
In general, though, is there a way to change the default attribute values for XML elements when they're entered in the editor? It would really make our life simple if that was the case.
Thanks!
I'd like to have the editor (using 9.3) automatically fill in the outputclass attribute to "stdimage" whenever I add an image to a DITA file. Our style guide requires a certain spacing around images, and the best way I've found to support that is through custom CSS. I'd like to make this brainless and thus change the default attribute value to our CSS class. I'd also like to change the default value of the placement attribute to be "break" as well for similar reasons.
In general, though, is there a way to change the default attribute values for XML elements when they're entered in the editor? It would really make our life simple if that was the case.
Thanks!
-
- Posts: 9438
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing default attribute values
Dear Eric,
The easiest way to change the defaults for attribute values is to modify the DTDs used to validate/parse the DITA topics.
In the OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/dtd/commonElements.mod file at line 622 you can find the allowed attributes for the image element. Just replace it with the following.
If you make the modification while Oxygen is running, please reopen the topics that are currently edited.
Regards,
Radu
The easiest way to change the defaults for attribute values is to modify the DTDs used to validate/parse the DITA topics.
In the OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/dtd/commonElements.mod file at line 622 you can find the allowed attributes for the image element. Just replace it with the following.
Code: Select all
<!ATTLIST image
href CDATA #REQUIRED
keyref NMTOKEN #IMPLIED
alt CDATA #IMPLIED
longdescref
CDATA #IMPLIED
height NMTOKEN #IMPLIED
width NMTOKEN #IMPLIED
align CDATA #IMPLIED
scale NMTOKEN #IMPLIED
placement (inline | break |
-dita-use-conref-target) "break"
%univ-atts;
outputclass (stdimage) "stdimage">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 2
- Joined: Sat Oct 18, 2008 12:05 am
Re: Changing default attribute values
Post by ericlandes »
Thanks for the response, Radu. I'll head off and make those changes.
This solution doesn't seem very scalable to an 8-person team, however. Seems like rollouts/future upgrades may prove difficult.
It would be wonderful if future versions have customization like this built into the UI...
This solution doesn't seem very scalable to an 8-person team, however. Seems like rollouts/future upgrades may prove difficult.
It would be wonderful if future versions have customization like this built into the UI...
-
- Posts: 9438
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Changing default attribute values
Hi Eric,
The only way to make a customization like this which would change the default attribute value for editing and also for transforming the topic is customizing the DTD. I do not see a way in which this would get implemented in a general way using a GUI.
Regards,
Radu
The only way to make a customization like this which would change the default attribute value for editing and also for transforming the topic is customizing the DTD. I do not see a way in which this would get implemented in a general way using a GUI.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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