// The validator will check that property values are well-formed,
// marking those that aren't, and identifies all URLs.
CssValidator v = new CssValidator(cssSchema, htmlSchema, mq)
.withInvalidNodeMessageLevel(MessageLevel.WARNING);
v.validateCss(AncestorChain.instance(decls));
// The rewriter will remove any unsafe constructs.
// and put URLs in the proper filename namespace
new CssRewriter(meta.getUriPolicy(), cssSchema, htmlSchema, mq)
.withInvalidNodeMessageLevel(MessageLevel.WARNING)
.rewrite(AncestorChain.instance(decls));