CSS3 namespaces not working as described in documentation

Oxygen general issues.
ctparker
Posts: 5
Joined: Sun Jan 20, 2008 2:10 am

CSS3 namespaces not working as described in documentation

Post by ctparker »

I'm having some issues getting CSS3 namespace selectors working in Author mode.

These are all equivalent and work as described in "Supported Features from CSS Level 3":

@namespace oxy 'http://www.oxygenxml.com/extensions/author';
@namespace oxy "http://www.oxygenxml.com/extensions/author";
@namespace oxy url(http://www.oxygenxml.com/extensions/author);
@namespace oxy url('http://www.oxygenxml.com/extensions/author');
@namespace oxy url("http://www.oxygenxml.com/extensions/author");

These do not work:

@namespace oxy 'http://www.oxygenxml.com/extensions/authorx';
@namespace oasis 'http://www.oasis-open.org/specs/tm9901.html';

Why does the URL matter? I was under the impression that it simply had to be a unique string. Are other namespaces even supported?

How do I know what the correct URL is for, say, the 'oasis' namespace?

For now, I seem to be able to get along with the "*|element" selector, but I have not been able to get a specific namespace to work, for instance: "oasis|table". Is this supported (aside from the 'oxy' namespace)?
Dan
Posts: 501
Joined: Mon Feb 03, 2003 10:56 am

Post by Dan »

Hello,

Please post the complete samples (XML and CSS) showing the problem. In the following you may find a working sample.

I used the Oasis namespace to define a table layout in the CSS:

Code: Select all



@namespace oasis 'http://www.oasis-open.org/specs/tm9901.html';

oasis|article{
display:block;
}

oasis|table{
display:table;
border:1px solid blue;
}

oasis|tr{
display:table-row;
}

oasis|td{
display:table-cell;
border:1px solid blue;
padding:20px;
}

*|td{
background-color:yellow;
}
The XML was:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="test.css"?>
<article xmlns="http://www.oasis-open.org/specs/tm9901.html">
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td>3</td>
</tr>
</table>


<!-- Table that is NOT in the Oasis namespace. -->
<table xmlns="">
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td>3</td>
</tr>
</table>

</article>
The first "table" element was rendered as a table, while the second was displayed as a block, because the second "table" element was not in the Oasis namespace.

I hope this helps,
Regards,
Dan
Post Reply