Syntax with string-join in CSS (child elements, normalize-space)
Oxygen general issues.
-
- Posts: 15
- Joined: Fri Mar 29, 2019 12:25 am
Syntax with string-join in CSS (child elements, normalize-space)
Hi everyone!
(this topic is stemming from: post53287.html)
Thanks to Sorin's indication, I was able to transfer one condition in oxy_xpath with quotes and apostrophes in string-join (inverting both quotes and apostrophes), either to display some content
or to have a combobox (the following one with a quite non-sensical condition (all references with the same date in the 20th century, based on date as string)
However, I apparently cannot display sub-elements as labels nor work with functions such as concat() or normalize-space().
When, again, the following is working to display a string
Is there an error in the code or syntax?
Thanks for any explanation,
Dominique
(this topic is stemming from: post53287.html)
Thanks to Sorin's indication, I was able to transfer one condition in oxy_xpath with quotes and apostrophes in string-join (inverting both quotes and apostrophes), either to display some content
Code: Select all
bibl[sameAs]{
content:oxy_xpath(
oxy_concat(
"doc('${cfdu}/biblio.xml')//listBibl/biblStruct[contains(@xml:id, '", attr(sameAs),"')]/normalize-space(string())"
)
);
}
Code: Select all
bibl[sameAs]:after{
content: "Reference-id"
oxy_combobox(edit, '@sameAs',
values,
oxy_xpath(
oxy_concat(
'string-join(doc("', oxy_url('${cfdu}/biblio.xml'), '")//listBibl/biblStruct[contains(@xml:id, substring-after("',attr(sameAs),'", "19"))]/@xml:id, ",")'
)),
editable, true,
labels,
oxy_xpath(
oxy_concat(
'string-join(doc("', oxy_url('${cfdu}/biblio.xml'), '")//listBibl/biblStruct[contains(@xml:id, substring-after("',attr(sameAs),'", "19"))]/@xml:id, ",")'
))
)
}
When, again, the following is working to display a string
Code: Select all
bibl[sameAs]{
content:oxy_xpath(
oxy_concat(
'string-join(doc("', oxy_url('${cfdu}/biblio.xml'), '")//listBibl/biblStruct[contains(attribute::xml:id, normalize-space("',attr(sameAs),'"))]/normalize-space(string()), ",")'
)
);
}
[\code]
I have tried with the following, with subelements that are present, always, once and only once.
[code]
bibl[sameAs]:after{
content: "Reference"
oxy_combobox(edit, '@sameAs',
values,
oxy_xpath(
oxy_concat(
'string-join(doc("', oxy_url('${cfdu}/biblio.xml'), '")//listBibl/biblStruct[contains(attribute::xml:id, "',attr(sameAs),'")]/@xml:id, ",")'
)),
editable, true,
labels,
oxy_xpath(
oxy_concat(
'string-join(doc("', oxy_url('${cfdu}/biblio.xml'), '")//listBibl/biblStruct[contains(attribute::xml:id, "',attr(sameAs),'")]/monogr/title/normalize-space(string()), ",")'
))
)
}
Thanks for any explanation,
Dominique
-
- Posts: 417
- Joined: Mon May 09, 2016 9:37 am
Re: Syntax with string-join in CSS (child elements, normalize-space)
Post by sorin_carbunaru »
Hello Dominique,
This is because your combo box is editable. For editable combo boxes we decided that we render the actual values. Let me tell you why... Let's say you could have 2 values in the CSS in the beginning, each having a label. Because the combo box is editable, the user could add a new one, the third. But they would provide the actual value to be added in the model, right?... So, how would they provide the label from the Author page?... See? Working with model values and rendered labels with editable combo boxes would be quite tricky...
You will see that if you made your combo box non-editable, the labels would be rendered.
By the way, I just wanted to also point out that, when needed, you could create your own form controls (see https://www.oxygenxml.com/doc/versions/ ... trols.html).
Best wishes,
Sorin Carbunaru
oXygen XML
This is because your combo box is editable. For editable combo boxes we decided that we render the actual values. Let me tell you why... Let's say you could have 2 values in the CSS in the beginning, each having a label. Because the combo box is editable, the user could add a new one, the third. But they would provide the actual value to be added in the model, right?... So, how would they provide the label from the Author page?... See? Working with model values and rendered labels with editable combo boxes would be quite tricky...
You will see that if you made your combo box non-editable, the labels would be rendered.
By the way, I just wanted to also point out that, when needed, you could create your own form controls (see https://www.oxygenxml.com/doc/versions/ ... trols.html).
Best wishes,
Sorin Carbunaru
oXygen XML
-
- Posts: 1
- Joined: Wed Apr 03, 2019 5:35 am
View first unread post
Post by fillipppyatochckin »
Hi,
How active are the moderators on here? My first post is awaiting approval.
It contained a link to a .SVG to help illustrate my question. This is hosted on my own website. Would that cause my post to go straight in the trash before even reaching a mod?
Thanks
Andrew
How active are the moderators on here? My first post is awaiting approval.
It contained a link to a .SVG to help illustrate my question. This is hosted on my own website. Would that cause my post to go straight in the trash before even reaching a mod?
Thanks
Andrew
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