CSS and processing-instruction contents

Oxygen general issues.
simonbate
Posts: 9
Joined: Mon Sep 28, 2009 7:39 pm

CSS and processing-instruction contents

Post by simonbate »

I'm using oxy|processing-instruction in the CSS to format some PIs in my content.

I want to do some additional processing on the content of the PI (presenting only pieces of it), but I can't see how to access the content so I can apply CSS functions, such as oxy_substring().

Is this even possible?
Radu
Posts: 9445
Joined: Fri Jul 09, 2004 5:18 pm

Re: CSS and processing-instruction contents

Post by Radu »

Hi Simon,

Could you give a small example of what you are trying to achieve?

Text content in the Author mode can be roughly divided in two categories:

1) Static text, text which is usually created on ":before" and ":after" selectors like:

Code: Select all


para:before{
content:"static text";
}
Such text is not editable and can be created and shown according to your needs.

2) Editable text, in your case the text inside a processing instruction. This is text the user edits and it can either be hidden completely (with a display:none for example) or shown. We do not have the possibility to only show a part of the editable text.

If you want users to edit only certain parts of the PI content you could also try to use form controls for this.
For example if in the XML content I have something like:

Code: Select all

<?xml-stylesheet type="text/xs32312l" href="../../../personal.xsl"?>
I can add some code in the CSS like:

Code: Select all

@namespace oxy "http://www.oxygenxml.com/extensions/author";

oxy|processing-instruction{
visibility:-oxy-collapse-text;
}

oxy|processing-instruction:before{
content:oxy_textfield(edit, "@type") oxy_textfield(edit, "@href");
}
which would hide the real content of the PI and edit its pseudo-attributes using 2 text fields. You could also try to implement a custom form control using our Java API.

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