#{xmlContentFirstPart}
") - htmlContentSecondPart = Nokogiri::XML("#{xmlContentSecondPart}
") - - # Get the id of the problematic entry - oldEntryId = entry.xpath('@xml:id').to_s - - # Split the id into page, paragraph, volume - volume, page, paragraph = splitEntryID(oldEntryId) - newPage = page + 1 - - # - # Insert the extracted content in the new paragraph - # - - # if the new paragraph is not created - # This is false when: - # -> There is inconcistency the first paragraph of the page - # has started in the previous entry - # -> The document is overwritten - # - if Search.exists?(page: newPage, volume: volume, paragraph: 1) - # Get existing paragraph - s = Search.find_by(page: newPage, volume: volume, paragraph: 1) - # Get paragraph record - pr = s.tr_paragraph - # Store the updated content for the paragraph record - pr.content_xml = xmlContentSecondPart - pr.content_html = htmlContentSecondPart.to_xml+""+ pr.content_html - pr.save + # if part is a block, create a Search object for that block using + # the existing ID but the new page number. + xml_part = part.gsub('xml:lang="sc"', 'xml:lang="sco"').gsub('xml:lang="la"', 'xml:lang="lat"').gsub('xml:lang="nl"', 'xml:lang="nld"') + entry_obj = Nokogiri::XML('#{part.gsub('
', "\n")}
"+xmlContentFirstPart.gsub('
', "\n")+"
"+xmlContentSecondPart.gsub('
', "\n")+"