SACMediaList media,
String defaultNamespaceURI)
throws CSSException
{
// instantiate a new parser and parse the stylesheet.
final ResourceManager manager = getResourceManager();
if (manager == null)
{
// there is no source set, so we have no resource manager, and thus
// we do no parsing.
//
// This should only be the case if we parse style-values; in that case
// include-statement are not supported anyway.
return;
}
try
{
CSSParserContext.getContext().setDefaultNamespace(defaultNamespaceURI);
final ResourceKey key;
if (source == null)
{
key = manager.createKey(uri);
}
else
{
key = manager.deriveKey(source, uri);
}
final Resource res = manager.create(key, source, StyleSheet.class);
if (res == null)
{
return;
}
final StyleSheet styleSheet = (StyleSheet) res.getResource();