Hussein Shafie wrote:
> Boris Goldowsky wrote:
>   
>> you'd have to create the new <level1> element, create 
>> the <h1> within it, move the content over piece by piece, 
>>     
>
> Why piece by piece? Please use node range selection whenever possible.
> See
> http://www.xmlmind.com/xmleditor/_distrib/doc/user/being_productive.html#node_range
>   
Right, as long as there are no sub-levels, this could be one step.

> Yes, it is painstaking because unfortunately the DTBook grammar has
> chosen the <level1>/<h1>, <level2>/<h2>, <level3>/<h3>, etc, design
> instead of choosing the <section> with <title> and nested <section>s design.
>   
Now that you mention it,  DTBook actually allows both types of 
structure.  So I am thinking what I might do is provide a command to 
convert the entire document to the simpler form with just <level> and 
<hd> - in which case this type of structural fixing would be much 
easier.  Then you could convert back if desired.

> We have written commands in Java[tm] for DocBook that do just this:
> *  Command "docb.demote"
> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditext/docbook/Demote.html
> * Command "docb.promote"
> http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditext/docbook/Promote.html
> We can send you the source code of these commands if you are interested.
>   
I would be interested to see what that looks like.
> It is also possible to write an XSLT transformation and use it in a
> process command (possibly itself invoked by a macro-command).
> * http://www.xmlmind.com/xmleditor/_distrib/doc/commands/process.html
> * http://www.xmlmind.com/xmleditor/_distrib/doc/commands/macro.html
>   

I can see how to invoke an XSLT on the document and put the result in a 
file, but is there a way to slurp the result back into the document 
being edited?

Bng

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20081031/1118b79c/attachment.htm
 

Reply via email to