overriding display of certain elements in Author View
Oxygen general issues.
overriding display of certain elements in Author View
hi.
TEI uses <egXML> for marking up examples of TEI itself when writing documentation etc. I'm wondering whether it would be possible, while using the Author View, to somehow override all the children of <egXML> to display as a block element but not using the Author View's tags, but rather using clean XML a là Editor View?
In other words, I am not interested in controlling the -oxy-tags-color and -oxy-tags-background-color, but rather displaying "proper" xml in the Author View for the children of <egXML>.
Any tips would be greatly appreciated.
All best,
Toma
TEI uses <egXML> for marking up examples of TEI itself when writing documentation etc. I'm wondering whether it would be possible, while using the Author View, to somehow override all the children of <egXML> to display as a block element but not using the Author View's tags, but rather using clean XML a là Editor View?
In other words, I am not interested in controlling the -oxy-tags-color and -oxy-tags-background-color, but rather displaying "proper" xml in the Author View for the children of <egXML>.
Any tips would be greatly appreciated.
All best,
Toma
Re: overriding display of certain elements in Author View
Hi Toma,
I once did something similar for DITA (didn't discard the approach - just postponed it):
xml sample code
css
Attributes are not supported yet...
Regards,
Patrik
I once did something similar for DITA (didn't discard the approach - just postponed it):
xml sample code
Code: Select all
<xml-codeblock>
<Root>
<Element>Text</Element>
<Element>More Text</Element>
<Element/>
</Root>
</xml-codeblock>
Code: Select all
xml-codeblock {
display: block;
font-family: "Courier New", monospace;
}
xml-codeblock * * {
display: block;
padding-left: 2em;
}
xml-codeblock *:before {
content: '<' oxy_xpath('name()') '>';
background-color: #EFEFEF;
}
xml-codeblock *:after {
content: '</' oxy_xpath('name()') '>';
background-color: #EFEFEF;
}
xml-codeblock *:empty:before {
content: '<' oxy_xpath('name()');
}
xml-codeblock *:empty:after {
content: "/>";
}
Regards,
Patrik
Re: overriding display of certain elements in Author View
many, many thanks, patrik for this hint. i added oxy_attributes() so now attributes display as well.
since all this is done through the css content property, i don't see how i could style element names, attributes and values differently — they all seem to have to be the same color. but having xml examples in the author view display as monochromatic xml will already be a big improvement for us.
all best,
toma
since all this is done through the css content property, i don't see how i could style element names, attributes and values differently — they all seem to have to be the same color. but having xml examples in the author view display as monochromatic xml will already be a big improvement for us.
all best,
toma
Re: overriding display of certain elements in Author View
To use different styles for the content you can use either different pseudo elements:
or use oxy_label():
But I don't see a reasonable way to assign different colors for attribut names and values with css only. You could do with it with a java plugin, though.
Regards,
Patrik
Code: Select all
xml-codeblock *:before(3) {
content: '<' oxy_name();
background-color: #EFEFEF;
color: blue;
}
xml-codeblock *:before(2) {
content: oxy_attributes();
background-color: #EFEFEF;
color: red;
}
xml-codeblock *:before(1) {
content: '>';
background-color: #EFEFEF;
color: blue;
}
Code: Select all
xml-codeblock *:before {
content: '<' oxy_name() oxy_label(text, oxy_attributes(), styles, "color: red;") '>';
background-color: #EFEFEF;
color: blue;
}
Regards,
Patrik
-
- Posts: 1008
- Joined: Wed Nov 16, 2005 11:11 am
Re: overriding display of certain elements in Author View
Post by alex_jitianu »
Hi Toma,
I think that I should also mention the text area form control, which right now can only edit the text content of an element. Starting with version 17.1 (the next version) this form control will also be able to edit the entire XML content of an element (so also structure). So it will look like a small text mode editor inside the author view. You will get syntax highlight as in the text page as well as content completion.
Although it can't help you right now, I felt the need to mention it for future users reading this post. Other than that, I think Patrik described perfectly what can be done right now.
Best regards,
Alex
I think that I should also mention the text area form control, which right now can only edit the text content of an element. Starting with version 17.1 (the next version) this form control will also be able to edit the entire XML content of an element (so also structure). So it will look like a small text mode editor inside the author view. You will get syntax highlight as in the text page as well as content completion.
Although it can't help you right now, I felt the need to mention it for future users reading this post. Other than that, I think Patrik described perfectly what can be done right now.
Best regards,
Alex
Re: overriding display of certain elements in Author View
Hi Alex,
will the editor be as comfortable as the text mode of oXygen? I.e. supporting content completion, automatically add closing tag, automatic indention...?
Patrik
will the editor be as comfortable as the text mode of oXygen? I.e. supporting content completion, automatically add closing tag, automatic indention...?
Patrik
-
- Posts: 1008
- Joined: Wed Nov 16, 2005 11:11 am
Re: overriding display of certain elements in Author View
Post by alex_jitianu »
Hi Patrik,
I hope so... It will have the features you've mentioned. But I can't guarantee that it will be completely the same experience because we also want to keep the component as lightweight as possible.
Best regards,
Alex
I hope so... It will have the features you've mentioned. But I can't guarantee that it will be completely the same experience because we also want to keep the component as lightweight as possible.
Best regards,
Alex
Re: overriding display of certain elements in Author View
Sounds great! :D
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