attr() as argument in oxy_substring
Oxygen general issues.
-
- Posts: 13
- Joined: Wed Oct 12, 2011 7:51 pm
attr() as argument in oxy_substring
Can the attr() be used as the value for the text using oxy_substring CSS function? I need to eliminate part of the xlink:href value of my <link> element to create links in Author. The syntax of the value must be maintained due to propriety IETM publishing software. My link element looks like this:
<link xlink:href="IETM://M00033" xmlns:xlink="http://www.w3.org/1999/xlink"><prompt>PROMPT TEXT</prompt></link>
I need to grab the substring "M00033" for file name of the linked to file.
I have tried the following:
link:before {link: oxy_substring(attr(xlink|href),7)".xml";}
and I have tried:
link:before {link: oxy_xpath("substring-after(attr(xlink|href),'IETM://')".xml";}
Neither method using Oxygen CSS custom extension functions is working. Is what I'm trying to do possible?
<link xlink:href="IETM://M00033" xmlns:xlink="http://www.w3.org/1999/xlink"><prompt>PROMPT TEXT</prompt></link>
I need to grab the substring "M00033" for file name of the linked to file.
I have tried the following:
link:before {link: oxy_substring(attr(xlink|href),7)".xml";}
and I have tried:
link:before {link: oxy_xpath("substring-after(attr(xlink|href),'IETM://')".xml";}
Neither method using Oxygen CSS custom extension functions is working. Is what I'm trying to do possible?
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: attr() as argument in oxy_substring
Hi Charles,
The main problem is that Oxygen contributes to each Author page with an implicit CSS file which contains this implicit rule:
Because this implicit contributed rule is marked as !important it overrides the property that you have set in your CSS file.
The workaround is to also mark your link property as important like:
Of course you also have to declare a namespace mapping at the beginning of your CSS file:
The alternative using XPath should have been like:
It does not properly work because when executing the XPath we should also declare mappings for the prefixes currently defined in the CSS files. I added an improvement request for this.
To make this work using the XPath expression for now you can use a more generic construct like:
Regards,
Radu
The main problem is that Oxygen contributes to each Author page with an implicit CSS file which contains this implicit rule:
Code: Select all
*[xlink|href]:before {
content:url(../images/link.gif);
link: attr(xlink|href) !important;
}
The workaround is to also mark your link property as important like:
Code: Select all
link:before {
link: oxy_concat(oxy_substring(attr(xlink|href), 7), ".xml") !important;
content: "LINK";
text-decoration:underline;
color:blue;
display:inline;
}
Code: Select all
@namespace xlink url('http://www.w3.org/1999/xlink');
Code: Select all
link: oxy_xpath("//*[@xlink:href]/substring-after(@xlink:href,'IETM://')") ".xml" !important;
To make this work using the XPath expression for now you can use a more generic construct like:
Code: Select all
link: oxy_xpath("//*[@*:href]/substring-after(@*:href,'IETM://')") ".xml" !important;
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: attr() as argument in oxy_substring
Hi,
Oxygen 13.2 which has just been released will try to map prefixes defined in the CSS xpath function by also looking at namespace mappings declared in the CSS file.
Regards,
Radu
Oxygen 13.2 which has just been released will try to map prefixes defined in the CSS xpath function by also looking at namespace mappings declared in the CSS file.
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