Requirement: 1. To generate separate html files for each pal:fragment element, for the source document attached ,the files gets name based on @fragment-id which is present on the pal:fragment elements. 2. The <pal:fragment> can be nested, wrapped with<div> element. 3. The fragmented file not only should include all child elements of pal:fragment, but also should include its ancestor <div> element. Each separate file generated from <pal:fragment should not include the content of its descendant <pal:fragment content.
See below examples for requirement understanding example1: if a fragment file is generated for <pal:fragment fragment-id="DLM3989039", the content should look like this (removed html markup for easy understanding)
============ Though With the sample file attached/mentioned above, number of separate html files generated are "11", which are as expected. There are Problems with XSLT stylesheet. The generated output looks like this: 1. ancestor nodes for a <foo:fragment> are not nested properly and does not include the fragment-content as it child/descendant, instead writing as sibling.