Resolve image location programmaticaly
Oxygen general issues.
-
- Posts: 12
- Joined: Sun Feb 27, 2011 10:30 am
Resolve image location programmaticaly
Hello,
I have a DTD (a S1000D DTD) which declare graphics prior to use their in the content :
I have to display the graphic at it's use point.
The graphic filename is the concatenation of the tags from "modelic" to "language" with an extension that is among a list of supported one : eg. AAAAA000000MM0001AF.(jpg|png|svg|...)
It's seems impossible to display the image using CSS (or I'm wrong). Is there another way to display the image ? Maybe programmaticaly ?
Thanks for your help,
Nicolas
I have a DTD (a S1000D DTD) which declare graphics prior to use their in the content :
Code: Select all
<!-- declaration -->
<icns>
<icn id="icn1">
<icn-c>
<modelic>AAAA</modelic>
<sdc>A</sdc>
<chapnum>00</chapnum>
<section>0</section>
<subsect>0</subsect>
<subject>00</subject>
<manualcode>MM</manualcode>
<illnum>0001</illnum>
<illver>A</illver>
<language language="F"/>
</icn-c>
</icn>
</icns>
[...]
<!-- content -->
<graphic callicn="icn1"/>
The graphic filename is the concatenation of the tags from "modelic" to "language" with an extension that is among a list of supported one : eg. AAAAA000000MM0001AF.(jpg|png|svg|...)
It's seems impossible to display the image using CSS (or I'm wrong). Is there another way to display the image ? Maybe programmaticaly ?
Thanks for your help,
Nicolas
-
- Posts: 12
- Joined: Sun Feb 27, 2011 10:30 am
Re: Resolve image location programmaticaly
I may have solved my problem. I have create a new StylesFilter where I set dynamically the mixed content with a custom URIContent. I extract the icn nodes to construct the filename.
I wonder if there can be performance issue
I wonder if there can be performance issue

-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Resolve image location programmaticaly
Hi,
Your found solution is good.
There was one more solution by using a powerful Oxygen CSS extension function called "xpath":
http://www.oxygenxml.com/doc/ug-editor/ ... ction.html
which would have allowed you from the CSS to use as content for the image element a complex XPath expression which would have joined the required values from the target element. But this approach would have been more processor intensive than your approach.
Probably your approach has some problems when the target element (from which you take the values to compose the image) is modified. The image element will not update on its own as is has already cached its content.
You can use our API to add a node changed listener to the Author page:
ro.sync.ecss.extensions.api.AuthorDocumentController.addAuthorListener(AuthorListener)
and when such a node is modified you can refresh the image element forcefully:
ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.refresh(AuthorNode)
The second approach (the xpath function) would have refreshed the entire document automatically but because of this it is more processor intensive and is usually suitable only for XML documents under 500 KBs.
Regards,
Radu
Your found solution is good.
There was one more solution by using a powerful Oxygen CSS extension function called "xpath":
http://www.oxygenxml.com/doc/ug-editor/ ... ction.html
which would have allowed you from the CSS to use as content for the image element a complex XPath expression which would have joined the required values from the target element. But this approach would have been more processor intensive than your approach.
Probably your approach has some problems when the target element (from which you take the values to compose the image) is modified. The image element will not update on its own as is has already cached its content.
You can use our API to add a node changed listener to the Author page:
ro.sync.ecss.extensions.api.AuthorDocumentController.addAuthorListener(AuthorListener)
and when such a node is modified you can refresh the image element forcefully:
ro.sync.exml.workspace.api.editor.page.author.WSAuthorEditorPageBase.refresh(AuthorNode)
The second approach (the xpath function) would have refreshed the entire document automatically but because of this it is more processor intensive and is usually suitable only for XML documents under 500 KBs.
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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