Steve Deal wrote:
> I am still learning CSS for XXE and I am trying to use a combo-box in
> CSS to list an enumeration of attributes of an element.   How do I
> reference the values of the element attribute for the combo-box?
> 
> The XML would look like this:    <languages lang="fr"/>
> 
> Given the schema snippet:
>       <xs:element name="languages" type="languages_ctype"/>
> 
>       <xs:complexType name="languages_ctype">
>               <xs:sequence>
>                       <xs:element name="language" type="my_lang_ctype" 
> maxOccurs="unbounded"/>
>               </xs:sequence>
>       </xs:complexType>
> 
>       <xs:complexType name="my_lang_ctype">
>               <xs:attribute name="lang" type="my_lang_enumeration" 
> use="required">
>               </xs:attribute>
>       </xs:complexType>
> 
>       <xs:simpleType name="my_lang_enumeration">
>               <xs:restriction base="xs:string">
>                       <xs:enumeration value="ar"/>
>                       <xs:enumeration value="en"/>
>                       <xs:enumeration value="de"/>
>                       <xs:enumeration value="fr"/>
>                       <xs:enumeration value="pt"/>
>               </xs:restriction>
>       </xs:simpleType>
> 
> My CSS looks like this:
> languages {
>     display: block;
>     content: element-name() "=" combo-box(attr(lang));
>     color: #0000FF;
>     margin: 1.33ex 0;
> } 
> 
> Should I be using:  languages[lang]  or something like that?

No.

"attr(lang)" represents the *string* which is the value of attribute 
"lang" of element "languages".

This is clearly *not* related to what you want to do. You want to 
generate a combo-box which allows to edit the attribute "lang" of 
element "languages".

Therefore, the CSS rule should be:
---
languages {
     display: block;
     content: element-name() "=" combo-box(attribute, lang);
     color: #0000FF;
     margin: 1.33ex 0;
}
---
See http://www.xmlmind.com/xmleditor/_distrib/docs/csssupport/ch05s05.html


Reply via email to