How to enable custom CSS properties in CSS validation

Oxygen general issues.
jbzech
Posts: 37
Joined: Fri May 20, 2011 6:07 pm

How to enable custom CSS properties in CSS validation

Post by jbzech »

My CSS stylesheets make use of some CSS3 paged media module properties and selectors as well as a properties that are specific to my software. When editing my CSS in Oxygen, I get a ton of errors and warnings because of this. It makes CSS validation not useful.

I saw your documentation for adding custom properties and values, but I can't seem to get it to work. I am to create a file called customProperties.xml and put it in the following folder: [Oxygen-install-folder]/endorsed/builtin/css-validator. But none of those directories exist, from "endorsed" on down. I created these folders and put my file in there, but it still doesn't work. Using just the placeholder you provided ("custom" property with "customValue1" and "customValue2"), I still couldn't get it to work. I see the schema you have for this XML file ([Oxygen install folder]/frameworks/css-support), but I can't figure out where to put my custom properties file and how to link it up with my CSS validation.

Is the documentation for this feature out of date? Am I doing something else wrong?

I know I could have the validator ignore my properties in the options panel, but it doesn't seem to work with my @ selectors and properties (used heavily in the paged media module). And I'd rather have defined custom properties that get validated.

Any suggestions?
alex_jitianu
Posts: 1017
Joined: Wed Nov 16, 2005 11:11 am

Re: How to enable custom CSS properties in CSS validation

Post by alex_jitianu »

Hi,

It seams that the documentation is somewhat incomplete. Sorry about that... I'll add an issue to correct it but in the meantime here is what you must do:
- the file must be named CustomProperties.xml and must looks like this:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<css_keywords
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.oxygenxml.com/ns/css http://www.oxygenxml.com/ns/css/CssProperties.xsd"
xmlns="http://www.oxygenxml.com/ns/css">
<property name="custom">
<summary>Description for custom property.</summary>
<value name="customValue"/>
<value name="anotherCustomValue"/>
</property>

</css_keywords>
- copy the file in the following folder structure: builtin/css-validator/. Pack the builtin folder into a JAR (Java ARchive). From a command line you can do it like so:

Code: Select all

jar cvf custom_props.jar builtin/
If you open the JAR with an archive tool (is just an ZIP) it must contain the entire folder structure: builtin/css-validator/CustomProperties.xml
- in {oxygenInstallDir}/lib create a new folder named endorsed and copy in it the previously create JAR file.

Best regards,
Alex
Post Reply