C# Class ContentFiltering.Html.CSSUtil

Provides static methods for working with CSS.
Datei anzeigen Open project: xwiki-contrib/xwiki-office Class Usage Examples

Public Methods

Method Description
ConvertInlineStylesToCssClasses ( XmlNode xnode, XmlDocument &xmlDoc, int &counter, Hashtable &cssClasses ) : XmlNode

Extracts inline styles and replaces them with CSS classes.

GroupCSSSelectors ( Hashtable existingCSSSelectors ) : Hashtable

Groups CSS selectors (CSS classes and ids) with the same properties to minify the generated CSS content.

InlineCSS ( XmlDocument &xmlDoc ) : void

Inlines CSS for nodes with an id and/or class attribute.

Private Methods

Method Description
CleanCSSProperties ( string style ) : string

Cleans CSS properties by allowing only valid properties.

ExtractCSSClassesAndIDs ( XmlDocument &xmlDoc ) : Hashtable

Extracts and removes the CSS classes and ids from the 'style' nodes. Deletes all the style nodes and creates a new one with unparsed CSS.

ExtractStyle ( XmlNode &node, XmlDocument &xmlDoc, int &counter, Hashtable &cssClasses ) : void

Extracts inline style from an XmlNode to a CSS class. Adds new CSS class to 'class' property of the node.

RemoveXOfficeCSSClasses ( XmlNode &node ) : void

Removes previous XOffice CSS classes from an XmlNode.

Method Details

ConvertInlineStylesToCssClasses() public static method

Extracts inline styles and replaces them with CSS classes.
public static ConvertInlineStylesToCssClasses ( XmlNode xnode, XmlDocument &xmlDoc, int &counter, Hashtable &cssClasses ) : XmlNode
xnode System.Xml.XmlNode Node to filter
xmlDoc System.Xml.XmlDocument A reference to the XmlDocument.
counter int
cssClasses System.Collections.Hashtable
return System.Xml.XmlNode

GroupCSSSelectors() public static method

Groups CSS selectors (CSS classes and ids) with the same properties to minify the generated CSS content.
public static GroupCSSSelectors ( Hashtable existingCSSSelectors ) : Hashtable
existingCSSSelectors System.Collections.Hashtable
return System.Collections.Hashtable

InlineCSS() public static method

Inlines CSS for nodes with an id and/or class attribute.
public static InlineCSS ( XmlDocument &xmlDoc ) : void
xmlDoc System.Xml.XmlDocument A reference to an XmlDocument.
return void