1

I am having trouble with the CSS Attribute Selector in Oxygen XML Editor 19.1. I used this example CSS selectors in Oxygen for creating a table, but instead of elements as table-cells I want to use the attributes of an given element.

My XML code:

<local-variables>
     <local-variable name="consumer-id"/>
     <local-variable name="result-meter-value" type="float"/>
</local-variables>

My CSS code:

local-variables {
display:table;
margin:2em;       
border:1px solid navy;
}
local-variable{
  display:table-row;
 }
local-variable[name],local-variable[type]{
  display:table-cell;
  min-width:500px;
  border:1px solid navy;
  padding:5px;
 }

But the Attribute Selectors local-variable[name] and local-variable[type] do not work. Does anyone have any suggestion?

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Lju
  • 117
  • 5

1 Answers1

2

It's not possible, at least with Oxygen's Author visual editing mode to create a table when you do not have elements which can be defined as cells. Also a CSS selector like "local-variable[name]" means "Match the element called 'local-variable' which has an existing attribute called 'name'". So it does not match an attribute, you cannot match an attribute in CSS, it matches an element which has an attribute. Maybe instead you can use Oxygen's form controls to add some text fields allowing you to edit each attribute value like:

local-variables, local-variable {
    display:block;
 }

local-variable {
   border: 1px solid gray;
   content: oxy_label(text, "Variable Name:", styles, "font-weight:bold;width:120px")
      oxy_textfield(edit, '@name', columns, 20) 
      oxy_label(text, "   Type:", styles, "width:80px")
      oxy_textfield(edit, '@type', columns, 20)
}

More about Oxygen XML Editor form controls:

https://www.oxygenxml.com/doc/versions/19.1/ug-editor/topics/dg-oxy-label-function.html https://www.oxygenxml.com/doc/versions/19.1/ug-editor/topics/text-field-editor.html

Radu Coravu
  • 1,754
  • 1
  • 9
  • 8