This page was generated
August  8,  2011
2:24  AM
XQuery Built-In and Modules Function Reference

Module: CSS Conversion

The CSS module is part of the conversion processing pipeline. These functions are used to manipulate CSS (Cascading style sheets) as part of conversion processing.

To use the CSS module as part of your own XQuery module, include the following line in your XQuery prolog:

import module namespace css = "http://marklogic.com/cpf/css" at "/MarkLogic/conversion/css.xqy"

You will need to ensure that the CSS module is loaded into the same modules database as the importing module.

The library namespace prefix css is not predefined in the server.

Function Summary
css:convert Convert CSS text to an equivalent XML representation that is more suitable for analysis.
css:get Fetch the CSS for the given document, be it embedded or linked.
Function Detail
css:convert(
$css as xs:string,
$options as element()?
)  as   element(css:styles)?
Summary:

Convert CSS text to an equivalent XML representation that is more suitable for analysis.

Parameters:
$css : The CSS text itself.
$options : Options for the conversion. The following options are defined: "html-style", the name of the CSS class on the "html" element; "body-style", the name of the CSS class on the "body" element. These style names are used to improve weighting heuristics. The options are in the "css:convert" namespace.

Example:
  xquery version "0.9-ml"
  import module namespace css = "http://marklogic.com/cpf/css" 
		  at "/MarkLogic/conversion/css.xqy"

  css:convert( css:get("http://example.com/mydoc.xhtml"), () )
  

css:get(
$doc as xs:string
)  as   xs:string
Summary:

Fetch the CSS for the given document, be it embedded or linked. Limitation: doesn't account for @import directives in the CSS; assumes the linked CSS is in the database.

Parameters:
$doc : The name of the parent document.

Example:
  xquery version "0.9-ml"
  import module namespace css = "http://marklogic.com/cpf/css" 
		  at "/MarkLogic/conversion/css.xqy"

  css:get("http://example.com/mydoc.xhtml")