Displaying processing instructions inline

<oXygen/> general issues.
honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Displaying processing instructions inline

Post by honyk » Tue Aug 18, 2009 2:27 pm

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

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying processing instructions inline

Post by sorin_ristache » Tue Aug 18, 2009 2:43 pm

Hello,

You have to override the default style:

Code: Select all

oxy|processing-instruction {
display: inline !important;
}

Regards,
Sorin

honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying processing instructions inline

Post by honyk » Tue Aug 18, 2009 2:49 pm

Even impotant! keyword doesn't help. Is it working for you in Author 10.3?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying processing instructions inline

Post by sorin_ristache » Tue Aug 18, 2009 3:31 pm

Yes it works. Did you enable displaying processing instructions in Preferences -> Editor -> Pages -> Author?


Regards,
Sorin

honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying processing instructions inline

Post by honyk » Tue Aug 18, 2009 4:32 pm

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.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying processing instructions inline

Post by sorin_ristache » Tue Aug 18, 2009 4:40 pm

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

honyk
Posts: 168
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying processing instructions inline

Post by honyk » Tue Aug 18, 2009 4:51 pm

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.

dcramer
Posts: 159
Joined: Sat Aug 28, 2010 1:23 am

Re: Displaying processing instructions inline

Post by dcramer » Wed Jan 26, 2011 8:19 pm

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;
}

Radu
Posts: 7201
Joined: Fri Jul 09, 2004 5:18 pm

Re: Displaying processing instructions inline

Post by Radu » Thu Jan 27, 2011 12:04 pm

Hi David,

What do you mean by "name" of the processing instruction?
It's target?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

dcramer
Posts: 159
Joined: Sat Aug 28, 2010 1:23 am

Re: Displaying processing instructions inline

Post by dcramer » Thu Jan 27, 2011 2:42 pm

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

Radu
Posts: 7201
Joined: Fri Jul 09, 2004 5:18 pm

Re: Displaying processing instructions inline

Post by Radu » Fri Oct 19, 2012 2:47 pm

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:

Code: Select all


<?t1 data="b"?>
with CSS selectors like:

Code: Select all


oxy|processing-instruction[t1]
or

Code: Select all


oxy|processing-instruction[data]
or

Code: Select all


oxy|processing-instruction[data=="b"]
or

Code: Select all


oxy|processing-instruction[t1][data=="b"]
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

dcramer
Posts: 159
Joined: Sat Aug 28, 2010 1:23 am

Re: Displaying processing instructions inline

Post by dcramer » Fri Oct 19, 2012 4:28 pm

Excellent! Thanks for the update.

David

Post Reply