CSS recursive oxy_substring
Oxygen general issues.
-
- Posts: 23
- Joined: Sat Mar 08, 2014 12:10 am
CSS recursive oxy_substring
Hello,
XML input:
I need to output only "Downtown" from my CSS.
I've tried a combination of nested oxy_indexof and oxy_substring with no luck.
Will someone please send me the correct syntax for this?
I also need to account for the condition of no "|" present.
I'd rather not run an XSLT on this.
THANKS
XML input:
Code: Select all
<NEIGHBORHOOD name="North America|Canada|British Columbia|Vancouver|Downtown"/>
I've tried a combination of nested oxy_indexof and oxy_substring with no luck.
Will someone please send me the correct syntax for this?
I also need to account for the condition of no "|" present.
I'd rather not run an XSLT on this.
THANKS
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: CSS recursive oxy_substring
Post by alex_jitianu »
Hello,
I think you can get the desired behavior by using these two rules:
The first one will handle the case when the name attribute has only one term and the second rule will get the last term from a | separated enumeration.
Best regards,
Alex
I think you can get the desired behavior by using these two rules:
Code: Select all
NEIGHBORHOOD:before {
content: attr(name)
}
NEIGHBORHOOD[name*="|"]:before {
content: oxy_substring(attr(name), oxy_add(oxy_lastindexof(attr(name), '|'), 1, integer))
}
Best regards,
Alex
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