How to modify built-in code fragments?
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
How to modify built-in code fragments?
Post by Frank Ralf »
Hi,
When adding a new <hazardstatement> element, Oxygen automatically adds the sub-structure like so:
How/Where can I modify that code fragment to also include a <consequence> element?
Best regards,
Frank
When adding a new <hazardstatement> element, Oxygen automatically adds the sub-structure like so:
Code: Select all
<hazardstatement>
<messagepanel>
<typeofhazard></typeofhazard>
<howtoavoid></howtoavoid>
</messagepanel>
</hazardstatement>
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to modify built-in code fragments?
Hi Frank,
One option if you have a DITA DTD/RNG specialization would be to modify the schema and declare "consequence" as a required child of hazardstatement. Probably now it is declared as an optional child.
Another option would be to have a custom content completion configuration file:
https://www.oxygenxml.com/doc/versions/ ... ually.html
and declare inside it:
and yet another possibility, replace in the content completion window the "hazardstatement" element with a custom Author action:
https://blog.oxygenxml.com/topics/custo ... etion.html
Regards,
Radu
One option if you have a DITA DTD/RNG specialization would be to modify the schema and declare "consequence" as a required child of hazardstatement. Probably now it is declared as an optional child.
Another option would be to have a custom content completion configuration file:
https://www.oxygenxml.com/doc/versions/ ... ually.html
and declare inside it:
Code: Select all
<elementProposals path="hazardstatement" insertElements="hazardstatement consequence"/>
https://blog.oxygenxml.com/topics/custo ... etion.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: How to modify built-in code fragments?
Post by Frank Ralf »
Hi Radu,
Thanks for the pointers. We don't want to touch the schema because even if we highly recommend to use the "consequence" element, we don't want to make it required. So we will go one of the other routes. I had already thought about the "Author Action" way but had forgotten about the custom content completion configuration file.
Best regards,
Frank
Thanks for the pointers. We don't want to touch the schema because even if we highly recommend to use the "consequence" element, we don't want to make it required. So we will go one of the other routes. I had already thought about the "Author Action" way but had forgotten about the custom content completion configuration file.
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: How to modify built-in code fragments?
Post by Frank Ralf »
Hi,
I created a custom configuration file cc_config_ext.xml as described in https://www.oxygenxml.com/doc/versions/ ... ually.html with the following content, which does the trick:
This creates the desired structure:
Thanks again for your kind help!
Frank
I created a custom configuration file cc_config_ext.xml as described in https://www.oxygenxml.com/doc/versions/ ... ually.html with the following content, which does the trick:
Code: Select all
<elementProposals path="messagepanel" insertElements="typeofhazard consequence howtoavoid" />
Code: Select all
<hazardstatement>
<messagepanel>
<typeofhazard />
<consequence />
<howtoavoid />
</messagepanel>
</hazardstatement>
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
Return to “DITA (Editing and Publishing DITA Content)”
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