CSS Element with or without an element
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 18
- Joined: Mon Dec 09, 2013 7:47 pm
CSS Element with or without an element
Hello,
I'm having problems styling a certain element with or without an attribute differently. The css is part of a project specific framework that contains also a template for new xml files. The framework has the highest priority of all frameworks within the frameworks collection. The oXygen version is 14.1.
In the CSS, in case a) the element has no attribute whereas in case b) the type attribute is specified
If I create a new file using the template of my framework the second selector is always used in the Author mode, when the attribute is found on the element and if it is not found. There is no different styling. If I change the order in the CSS and b) is declared before a) the declaration for b) is still effective, more powerful. Is there a chance to accomplish a different styling?
If I create a new, arbitrary file not using the template of my framework and add the elements <mentioned> and <mentioned type="Z">, the styling of both options is correct, the CSS works.
Maybe there's a problem with the preferences of my framework?
Thanks,
Franziska
I'm having problems styling a certain element with or without an attribute differently. The css is part of a project specific framework that contains also a template for new xml files. The framework has the highest priority of all frameworks within the frameworks collection. The oXygen version is 14.1.
In the CSS, in case a) the element has no attribute whereas in case b) the type attribute is specified
Code: Select all
/* Example for a) */
mentioned{
font-style:italic;
-oxy-placeholder-content:"placeholder XY";
}
Code: Select all
/* Example for b) */
mentioned[type="Z"]{
font-style:italic;
-oxy-placeholder-content:"placeholder Z";
}
If I create a new, arbitrary file not using the template of my framework and add the elements <mentioned> and <mentioned type="Z">, the styling of both options is correct, the CSS works.
Maybe there's a problem with the preferences of my framework?
Thanks,
Franziska
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: CSS Element with or without an element
Hi Franziska,
It is possible that in the schema or DTD associated to your XML document, the attribute "type" is specified as having the default value "Z".
When Oxygen looks to see if the attributes on a certain element match a certain CSS attribute selector, it also looks in the schema to see if for a certain missing attribute there is a default value and if so that default value is used to match the CSS selector.
Probably when you create a new XML without any schema associated the CSS selector is not matched anymore because the schema associated to the XML is not found by Oxygen.
Regards,
Radu
It is possible that in the schema or DTD associated to your XML document, the attribute "type" is specified as having the default value "Z".
When Oxygen looks to see if the attributes on a certain element match a certain CSS attribute selector, it also looks in the schema to see if for a certain missing attribute there is a default value and if so that default value is used to match the CSS selector.
Probably when you create a new XML without any schema associated the CSS selector is not matched anymore because the schema associated to the XML is not found by Oxygen.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 18
- Joined: Mon Dec 09, 2013 7:47 pm
Re: CSS Element with or without an element
Hello Radu,
thank you for the explanation and the hint!
In the schema, there is the following declaration for the element mentioned:
If I delete the declaration of the fixed value (fixed="Z") in the schema, the styling of both options, with or without the attribute in the Author mode, is correct.
Is there a chance to have both, the correct styling for the two options in the xml and to mantain the declaration of the fixed value "Z" in the schema?
Regards,
Franziska
thank you for the explanation and the hint!
In the schema, there is the following declaration for the element mentioned:
Code: Select all
<xsd:complexType name="mentioned" mixed="true">
<xsd:attribute name="type" fixed="Z" use="optional"/>
</xsd:complexType>
Is there a chance to have both, the correct styling for the two options in the xml and to mantain the declaration of the fixed value "Z" in the schema?
Regards,
Franziska
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: CSS Element with or without an element
Hi Franziska,
Sorry, but the CSS rendering is applied as if the default attributes specified in the schema are present in the XML document.
Regards,
Radu
Sorry, but the CSS rendering is applied as if the default attributes specified in the schema are present in the XML document.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service