Oxygen XML Framwork - Build dynamic links

Post here questions and problems related to editing and publishing DITA content.
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Oxygen XML Framwork - Build dynamic links

Post by xephon »

Hi,

I used the following CSS rules in my LESS file to dynamically generate links for an element like this:

Element

Code: Select all

<issue project="project1" number="1234"/>
CSS

Code: Select all

*[class ~= "history-d/issue"]:before(5) {
content: "Jira: ";
display: inline-block;
width: 50px;
}

*[class ~= "history-d/issue"]:before(4) {
content: attr(project) "-" attr(number);
link: "http://jira.xxxx.de/browse/" attr(project) "-" attr(number);
color: navy;
display: inline-block;
width: 150px;
float: right;
}

*[class ~= "history-d/issue"]:before(3) {
content: "Projekt: "
oxy_editor(
type, combo,
edit, "project",
editable, true,
values, "project1, project2",
labels, "Project 1, Project 2"
);
display: inline-block;
float: right;
width: 100px;
}

*[class ~= "history-d/issue"]:before(2) {
content: " Nummer: "
oxy_textfield(
edit, "@number",
columns, 4,
values
);
display: inline-block;
float: right;
width: 100px;
}
However that was before the release of the Release Management domain. Now I'd like to switch to the Release Management domain, but the pendant is slightly more complex:

Code: Select all

<change-request-reference>
<change-request-system>project1</change-request-system>
<change-request-id>1234</change-request-id>
</change-request-reference>
Now I'd like to have the same link generator, but that would mean, that I'd need to read the value of a different element in a CSS rule of another element. I need to walk from <change-request-id> to <change-request-system>.

tl;dr question: Can I use XPATH expressions in CSS rules (oxy_ Elements)? :roll:
stefan-jung.org – Your DITA/DITA-OT XML consultant
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Oxygen XML Framwork - Build dynamic links

Post by Radu »

Hi Stefan,

You can use our oxy_xpath CSS extension function:

https://www.oxygenxml.com/doc/versions/ ... ction.html

It comes with a penalty hit on the editing side because Oxygen needs to do more computations but DITA topics being small it should not matter much.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Oxygen XML Framwork - Build dynamic links

Post by xephon »

Excellent, thanks a lot.
stefan-jung.org – Your DITA/DITA-OT XML consultant
Post Reply