Author mode css styling
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 13
- Joined: Wed Mar 01, 2023 5:45 pm
Author mode css styling
I have an element that references other elements via the attribute <internalRef internalRefId=""/>. I want to return the name/text() of the matching @id. My css is below. If i specifically state the @internalRefId ( oxy_link-text(oxy_xpath("//*[@id = 'sup-0001']/name/text()"));), i get a value. But obviously it will return the same name for all internalRef. Can this be done?
Code: Select all
internalRef:before {
-oxy-link:oxy_concat('#',attr(internalRefId));
color : #000080 ;
content : url("../img/link.png")
""
oxy_combobox(edit, "@internalRefId", columns, 10)
oxy_link-text(oxy_xpath("//*[@id = @internalRefId]/name/text()"));
font-size : 16px ;
font-style : normal ;
font-weight : 400 ;
line-height : 120.00001% ;
text-decoration-color : #000080 ;
text-decoration-line : underline ;
text-decoration-style : solid ;
}
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Author mode css styling
Hi,
The oxy_link-text() CSS function in general receives no parameter:
https://www.oxygenxml.com/doc/versions/ ... -text.html
It gets expanded usually by a specific Java extension placed in the framework configuration, like for example we have such implementations for DITA and DocBook:
https://www.oxygenxml.com/InstData/Edit ... olver.html
https://www.oxygenxml.com/doc/versions/ ... undle.html
Such resolvers are useful because we do not really want to use oxy_xpath in the CSSs we ship for DITA and DocBook as the oxy_xpath may induce performance problems when working with large documents.
https://www.oxygenxml.com/doc/versions/ ... ction.html
Anyway, coming back to your CSS code, it could be changed something like this:
So in this case I used oxy_concat inside of oxy_xpath in order to expand the literal attribute value of the current element in the XPath expression. I did not test this but I think as another workaround the XPath can also be written I think by using a "let" expression to save the current value of @internalRefId and then use that value further like:
Regards,
Radu
The oxy_link-text() CSS function in general receives no parameter:
https://www.oxygenxml.com/doc/versions/ ... -text.html
It gets expanded usually by a specific Java extension placed in the framework configuration, like for example we have such implementations for DITA and DocBook:
https://www.oxygenxml.com/InstData/Edit ... olver.html
https://www.oxygenxml.com/doc/versions/ ... undle.html
Such resolvers are useful because we do not really want to use oxy_xpath in the CSSs we ship for DITA and DocBook as the oxy_xpath may induce performance problems when working with large documents.
https://www.oxygenxml.com/doc/versions/ ... ction.html
Anyway, coming back to your CSS code, it could be changed something like this:
Code: Select all
internalRef:before {
-oxy-link:oxy_concat('#',attr(internalRefId));
color : #000080 ;
content : url("../img/link.png")
""
oxy_combobox(edit, "@internalRefId", columns, 10)
oxy_xpath(oxy_concat("//*[@id =", attr(internalRefId), "]/name/text()"));
...
}
Code: Select all
oxy_xpath("let $abc := @internalRefId return //*[@id = $abc]/name/text()")
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