Processing instruction style does not show up in DocBook cus
Oxygen general issues.
-
- Posts: 58
- Joined: Sat Aug 01, 2009 12:57 am
Processing instruction style does not show up in DocBook cus
I am trying to apply certain style to some professing instructions in my DocBook customization. It does not work. I copied the style directly from Developer's guide.
The similar style for comment works, but the one for processing instruction does not.
Here is what I am trying to accomplish in the end. I have lots of <?pr-line-feed?> PIs in my source. They need to be converted into line breaks in Author mode. Can this be done with CSS? I was planning on doing something like following:
Thanks for all the help.
Code: Select all
@namespace oxy url('http://www.oxygenxml.com/extensions/author');
oxy|processing-instruction {
display:block;
color:purple;
background-color:transparent;
}
Here is what I am trying to accomplish in the end. I have lots of <?pr-line-feed?> PIs in my source. They need to be converted into line breaks in Author mode. Can this be done with CSS? I was planning on doing something like following:
Code: Select all
oxy|processing-instruction:before {
content: xpath(if name() = pr-line-feed then 
 else '');
}
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Processing instruction style does not show up in DocBook cus
Hi,
Processing instructions are not shown by default by Oxygen in the Author page.
You can check the "Show Processing Instructions" checkbox from the Oxygen Preferences->Editor / Pages / Author.
After they are shown the first selector described in the Developer guide should work.
There is a problem with the xpath selector for inserting the forced line break due to a bug in Oxygen.
The correct CSS selector construct should be:
But in the current Oxygen version there is a problem interpreting a relative XPath expression when the current node is a PI or CData or an XML comment.
I added a bug to our issues list and a fix for this will probably be available in the next version of Oxygen (probably in September this year).
Regards,
Radu
Processing instructions are not shown by default by Oxygen in the Author page.
You can check the "Show Processing Instructions" checkbox from the Oxygen Preferences->Editor / Pages / Author.
After they are shown the first selector described in the Developer guide should work.
There is a problem with the xpath selector for inserting the forced line break due to a bug in Oxygen.
The correct CSS selector construct should be:
Code: Select all
oxy|processing-instruction:before {
content: xpath("if (name() = 'pr-line-feed') then '\A' else ''");
}
I added a bug to our issues list and a fix for this will probably be available in the next version of Oxygen (probably in September this year).
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 58
- Joined: Sat Aug 01, 2009 12:57 am
Re: Processing instruction style does not show up in DocBook cus
So the relative xpath does not work for processing instructions? It returns document node for current node.
I have something working by doing this:
Another thing I noted that CSS for PIs don't work unless it has "!important" modifier.
Would I be able to implement this properly using StylesFilter or some other API?
I have something working by doing this:
Code: Select all
oxy|processing-instruction {
display: inline !important;
visibility: visible;
}
oxy|processing-instruction:after {
content: "\A";
}
Would I be able to implement this properly using StylesFilter or some other API?
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Processing instruction style does not show up in DocBook cus
Hi,
That's why you usually have to specify the !important flag for some properties, to override the ones in the default CSS.
Regards,
Radu
Exactly. This bug will be fixed in the next released.So the relative xpath does not work for processing instructions? It returns document node for current node.
Oxygen contributes with a default CSS to the Author page. The default CSS has the following selector for processing instructions:Another thing I noted that CSS for PIs don't work unless it has "!important" modifier.
Code: Select all
oxy|processing-instruction {
display:block !important;
color: rgb(139, 38, 201) !important;
white-space:pre !important;
border-width:0px !important;
margin:0px !important;
padding: 0px !important;
}
Unfortunately you would not be able to detect the PI content (target and data) using the StylesFilter. Oxygen wraps the PI in a fake element node in order to match correctly the properties in the CSS file. We'll see if we can also improve this aspect.Would I be able to implement this properly using StylesFilter or some other API?
Regards,
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: Processing instruction style does not show up in DocBook cus
Hi,
In Oxygen 13 which will be available shortly you will be able to do this either by using the XPath expression discussed above or by implementing our StylesFilter API.
Regards,
Radu
In Oxygen 13 which will be available shortly you will be able to do this either by using the XPath expression discussed above or by implementing our StylesFilter API.
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