On 07/24/2012 11:00 AM, arcasys wrote:
> I'd like to share some observations I've made while trying to transform
> a legacy text document to Docbook 5.0.
>
> The source actually is a textile formatted piece of text. While there
> certainly are easier ways to do a conversion to DocBook I wanted to gain
> some experience in modifying and restructuring a document because this
> will be the main purpose of the exercise: gather pieces of information
> scattered over a number of Wikis and How-to's and create a consolidated
> and well structured document that can be published as HTML, PDF, etc.
>
> Thus I created a book and a chapter each in a single file, the book
> referencing the chapter, This works fine.
> Then I created a section in the chapter and tried to copy the source
> text into the chapter. Not too surprisingly all white space is treated
> the same, i.e. line feeds are not seen as line feeds any more. So I
> wrapped every line in a <para></para> before importing. Better.
>
> Now I tried to recreate the original structure by using the different
> insert, paste, replace, and convert commands as explained in the tutorial.
> I had a really hard time because most of it did not work as expected...
> I must be doing something wrong.
> Now I ran a validation and worked through the findings: naturally, there
> were a couple of tags coming from the textile markup like </pre> etc.
> Once I eliminated all errors things became a lot easier because commands
> which behaved confusing now worked as expected.
>
> However, there are still some obscurities:
>
> The document showed no validation errors when I closed it. After
> reopening the document (in the context of the book) I performed a
> validation again and the following error was found:
> The number of seg elements must be the same as the number of segtitle
> elements in the parent segmentedlist

I cannot reproduce this problem: having no validation errors when you 
save a document and having  validation errors when you reopen it. (In 
fact, this is technically impossible.)



>
> Obviously only one seg element is allowed.

No, not at all. You probably need to add segtitle elements to the 
segmentedlist. (Click on the first segtitle and use "Insert After".)

For example, if your segmentedlist element contains a number of 
segmentedlistitem child elements, each segmentlistitem containing 3 seg 
elements, then the segmentedlist must start with 3 segtitle elements.



> But if I select a seg node
> and try 'insert after' the only element offered is 'seg'. How can that be?

You seem to be using a (rarely used) element --segmentedlist-- that you 
do not fully understand. Please refer to

http://www.docbook.org/tdg5/en/html/segmentedlist.html

in order to learn how to use a segmentedlist.




>
> Similarly, other tags inserted using insert or paste created errors
> because the tags were not allowed at this place. Shouldn't xxe avoid
> this in the first place? What am I doing wrong?

I cannot reproduce this problem you describe when the document being 
edited is originally structurally valid (no red icon at the bottom/left 
of the main window).

On the other hand, when a document is structurally invalid, XXE works in 
a lenient mode which lets you do more or less whatever you want.



>
> I expected that a series of paras could be converted to an itemizedlist
> by selecting the paras and applying either convert[wrap] or replace:
> convert[wrap] does not offer 'itemizedlist', replace does but creates an
> empty list and the contents of the selected paras are lost.

convert[wrap] is a generic command which simply does not work like this.



> So how can this be done?

Please copy one or more blocks of text from a *text* *editor* where your 
textile document is opened and then use
"DocBook|Paste After As|itemizedlist" to paste the contents of the 
clipboard in XXE.

More information in 
http://www.xmlmind.com/xmleditor/_distrib/doc/docbook/docbook_menu.html



>
> I created another document and some elements within the document, e.g.
> an 'informaltable'. I can select an element and choose copy but when I
> move to another document within xxe Paste is not offered. Can elements
> not be copied between different documents?

Copy/paste works between documents of the same type.

Let's assume that you have selected the right element in the document 
where you want to paste something and that you are attempting to use the 
right paste command (Paste Before or Paste or Paste After).

My guess is that you could have made a simple mistake. For example, your 
first document is a DocBook 5 document and your second document is a 
DocBook 4 document. DocBook 4 & 5 elements have different namespaces, 
therefore copy/paste is impossible between these 2 documents.





>
> Don't get me wrong. XXE appears to be a great product. The tutorials are
> good in their shortness (otherwise no one would read them).
> But in some cases I seem to miss the obvious ...
>

Trying to transform  a legacy text document to Docbook 5.0 is not a easy 
task whatever tool you may use. Moreover, for this task, you are using a 
tool, XXE:

* that you don't know very well,

* which has not been designed to be really usable with structurally 
invalid documents (red icon at the bottom/left of the main window).

I mean, when you convert a legacy text document to structured XML, you 
often end up having structurally invalid XML that you must fix by hand, 
error after error. Unfortunately, XXE has not been designed make it easy 
fixing structurally invalid XML. Instead it has been designed to always 
author structurally valid XML.
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to