Hello,

In the DTD I am working with (DAISY DTBook), sections can be nested like 
this:

<level1>
   <h1>header</h1>
   <p>Introduction</p>
   ...
   <level2>
      <h2>header</h2>
      <p>Text</p>
      ...
   </level2>
   ...
</level1>

Up to <level6>.

Sometimes one needs to promote or demote a section -- ie, you might want 
to change the above to be two sibling <level1> elements.

If I'm not missing something, then this is an incredibly painstaking 
operation in XXE - you'd have to create the new <level1> element, create 
the <h1> within it, move the content over piece by piece, then delete 
the skeleton of the old <level2>.  If the <level2> you were promoting 
contained <level3> elements, there would be exponentially more steps.

Is there any way to automate this that isn't terribly complicated?  
Macro, Java command, something else?  If I write an XSLT that does the 
transformation, can I call that from a menu item (and pass it the 
selected node)?  Any examples of similar processing that I could look at?

Thanks for any help!

Boris


Reply via email to