preprocessHtml.groovy 841 B

12345678910111213141516171819202122232425262728293031323334
  1. import groovy.xml.MarkupBuilder
  2. import groovy.xml.StreamingMarkupBuilder
  3. println "Hello, Script!!!"
  4. def fragments = new XmlParser(false, true).parseText("<html><body></body></html>")
  5. def resultFile = new File('/home/mlutescu/0_WORK/SGXUserGuide/developer_guide_eclipse_plugin/Output/WebHelp/Content/test.html')
  6. if (resultFile.exists()) {
  7. resultFile.delete()
  8. }
  9. def fltoc = new File('/home/mlutescu/0_WORK/SGXUserGuide/developer_guide_eclipse_plugin/Project/TOCs/Master.fltoc')
  10. def toc = (new XmlParser()).parse(fltoc)
  11. def contentDir = new File(fltoc, '../../../').canonicalPath
  12. def PrintWriter pw = new PrintWriter(new FileWriter(resultFile))
  13. toc.TocEntry['**'].each { tocEntry ->
  14. def htmlFile = new File(contentDir, "${tocEntry.'@Link'}")
  15. println htmlFile.text
  16. }
  17. println groovy.xml.XmlUtil.serialize( fragments)