this.resourceManager = layoutProcess.getResourceManager();
final ArrayList pageRules = new ArrayList();
final ArrayList counterRules = new ArrayList();
final ArrayList styleRules = new ArrayList();
final DocumentContext dc = this.layoutProcess;
namespaces = dc.getNamespaces();
final String[] nsUri = namespaces.getNamespaces();
for (int i = 0; i < nsUri.length; i++)
{
final String uri = nsUri[i];
final NamespaceDefinition nsDef = namespaces.getDefinition(uri);
final ResourceKey rawKey = nsDef.getDefaultStyleSheetLocation();
if (rawKey == null)
{
// there is no default stylesheet for that namespace.
continue;
}
final ResourceKey baseKey = layoutProcess.getContextKey();
final StyleSheet styleSheet = parseStyleSheet(rawKey, baseKey);
if (styleSheet == null)
{
continue;
}
// Log.debug("Loaded stylesheet from " + rawKey + " for namespace " + nsDef.getURI());
addStyleRules(styleSheet, styleRules);
addPageRules(styleSheet, pageRules);
addCounterRules(styleSheet, counterRules);
}
final StyleReference[] refs = dc.getStyleReferences();
for (int i = 0; i < refs.length; i++)
{
final StyleReference ref = refs[i];
if (ref.getType() == StyleReference.LINK)
{