/** * @see org.opencms.xml.A_CmsXmlDocument#initDocument(org.dom4j.Document, java.lang.String, org.opencms.xml.CmsXmlContentDefinition) */ @Override protected void initDocument(Document document, String encoding, CmsXmlContentDefinition definition) { m_document = document; m_contentDefinition = definition; m_encoding = CmsEncoder.lookupEncoding(encoding, encoding); m_elementLocales = new HashMap<String, Set<Locale>>(); m_elementNames = new HashMap<Locale, Set<String>>(); m_locales = new HashSet<Locale>(); clearBookmarks(); // initialize the bookmarks for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(m_document.getRootElement()); i.hasNext();) { Element node = i.next(); try { Locale locale = CmsLocaleManager.getLocale( node.attribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_LANGUAGE).getValue()); addLocale(locale); processSchemaNode(node, null, locale, definition); } catch (NullPointerException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_INIT_BOOKMARKS_0), e); } } }
/** * @see org.opencms.xml.A_CmsXmlDocument#initDocument(org.dom4j.Document, java.lang.String, org.opencms.xml.CmsXmlContentDefinition) */ @Override protected void initDocument(Document document, String encoding, CmsXmlContentDefinition definition) { m_document = document; m_contentDefinition = definition; m_encoding = CmsEncoder.lookupEncoding(encoding, encoding); m_elementLocales = new HashMap<String, Set<Locale>>(); m_elementNames = new HashMap<Locale, Set<String>>(); m_locales = new HashSet<Locale>(); clearBookmarks(); // initialize the bookmarks for (Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(m_document.getRootElement()); i.hasNext();) { Element node = i.next(); try { Locale locale = CmsLocaleManager.getLocale(node.attribute( CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_LANGUAGE).getValue()); addLocale(locale); processSchemaNode(node, null, locale, definition); } catch (NullPointerException e) { LOG.error(Messages.get().getBundle().key(Messages.LOG_XMLCONTENT_INIT_BOOKMARKS_0), e); } } }
processSchemaNode(element, path, locale, nestedSchema.getNestedContentDefinition());
processSchemaNode(element, path, locale, nestedSchema.getNestedContentDefinition());