Page 1 of 1
Displaying processing instructions inline
Posted: Tue Aug 18, 2009 2:27 pm
by honyk
Hello,
I have set in customized Docbook css style like this
Code: Select all
oxy|processing-instruction {
display: inline;
}
but it is still displayed as block, even after restarting of Oxygen. Is it necessary to set something else or it is not possible?
Jan
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 2:43 pm
by sorin_ristache
Hello,
You have to override the default style:
Code: Select all
oxy|processing-instruction {
display: inline !important;
}
Regards,
Sorin
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 2:49 pm
by honyk
Even impotant! keyword doesn't help. Is it working for you in Author 10.3?
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 3:31 pm
by sorin_ristache
Yes it works. Did you enable displaying processing instructions in Preferences -> Editor -> Pages -> Author?
Regards,
Sorin
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 4:32 pm
by honyk
I've checked your code on another PC with the same result as on mine (with processing instruction switched on). If the following code is used
Code: Select all
<copyright>
<year><?dbtimestamp format="Y"?></year>
<holder>MyCompany</holder>
</copyright>
Year and holder are on separate lines. If PI is replaced with any text, both elements are on the same line.
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 4:40 pm
by sorin_ristache
Try the following XML file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="pi-inline.css"?>
<copyright>
<year><?dbtimestamp format="Y"?></year>
<holder>MyCompany</holder>
</copyright>
and create a file pi-inline.css in the same folder as the above XML file with the content:
Code: Select all
@namespace oxy url('http://www.oxygenxml.com/extensions/author');
oxy|processing-instruction {
display:inline !important;
}
When you edit the XML file in Author mode you see
dbtimestamp format="Y" and
MyCompany on the same line. If you replace
inline with
block in the CSS you see
dbtimestamp format="Y" and
MyCompany on two different lines.
Regards,
Sorin
Re: Displaying processing instructions inline
Posted: Tue Aug 18, 2009 4:51 pm
by honyk
Sorry, my fault, I didn't know it is necessary to include namespace info, I thought it is known to Oxygen by default. Now it works fine. Thanks for patience.
Re: Displaying processing instructions inline
Posted: Wed Jan 26, 2011 8:19 pm
by dcramer
It would be cool if you could select the PI based on its name so you could style different pis in different ways:
Code: Select all
oxy|processing-instruction['sbr']{
display: inline !important;
}
oxy|processing-instruction{
display: block !important;
}
Re: Displaying processing instructions inline
Posted: Thu Jan 27, 2011 12:04 pm
by Radu
Hi David,
What do you mean by "name" of the processing instruction?
It's target?
Regards,
Radu
Re: Displaying processing instructions inline
Posted: Thu Jan 27, 2011 2:42 pm
by dcramer
Yes, I was thinking of the PITarget (that part that's emitted by the name attr in the xsl:processing-instruction). Then I could display <?sbr?> inline and most others as block. But if you do that, won't people then want to match based on the text content of the PI too? I suppose so, but css is too anemic for that kind of matching. What I really want is to be able to xslt-like things in css, but that's impossible:
Code: Select all
oxy|processing-instruction[contains(.,'foo')]
I guess let me think more what I really want/need to do. Perhaps I can get by just making them all inline.
David
Re: Displaying processing instructions inline
Posted: Fri Oct 19, 2012 2:47 pm
by Radu
Hi David,
Oxygen 14.1 was just released and it added the ability to match from the CSS processing instructions either by target or by certain pseudo attributes which are set.
For example you can match this PI:
with CSS selectors like:
or
or
Code: Select all
oxy|processing-instruction[data=="b"]
or
Code: Select all
oxy|processing-instruction[t1][data=="b"]
Regards,
Radu
Re: Displaying processing instructions inline
Posted: Fri Oct 19, 2012 4:28 pm
by dcramer
Excellent! Thanks for the update.
David