DocBook files to TXT

krosenkranz
Posts: 2
Joined: Sat Jun 28, 2014 12:16 am

DocBook files to TXT

Post by krosenkranz » Sat Jun 28, 2014 12:33 am

Hey there,

I have some simple content (no tables, no figures) in DocBook that I currently transform to PDF.

Now, I have a requirement to transform to a plain text file, as well.

Any pointers for doing this in Oxygen 16 using transformation scenarios?

(I've found a few comments about doing this, but mostly very old comments.)

Thanks!

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: DocBook files to TXT

Post by sorin_ristache » Mon Jun 30, 2014 10:49 am

Hello,

You could copy all visible content in Author mode (Ctrl+A in Author mode for Select All and Ctrl+C for Copy), create a new file of TEXT type (Ctrl+N, type "text" in the New dialog) and paste the copied content in the TEXT file (Ctrl+V for Paste). This copy and paste operation will remove all XML tags and keep only the text content of the DocBook XML document.

I think this is almost the same as running the following XSLT stylesheet over the DocBook XML document:

Code: Select all

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="text()[string-length(normalize-space()) = 0]">
<xsl:text>
</xsl:text>
</xsl:template>

<xsl:template match="@*"/>
</xsl:stylesheet>

Regards,
Sorin

krosenkranz
Posts: 2
Joined: Sat Jun 28, 2014 12:16 am

Re: DocBook files to TXT

Post by krosenkranz » Mon Jun 30, 2014 6:55 pm

Thank you, Sorin!

Nice and simple, and does exactly what I want.

Kurt

RandyBonnette
Posts: 1
Joined: Wed Jun 26, 2019 8:39 am

Re: DocBook files to TXT

Post by RandyBonnette » Wed Jun 26, 2019 8:44 am

Hello,

Is it possible to generate pdf from DocBook 5.0? Also: how can I perform this action with Oxygen 18.1: Associating a File Extension with Oxygen XML Developer?

Radu
Posts: 6393
Joined: Fri Jul 09, 2004 5:18 pm

Re: DocBook files to TXT

Post by Radu » Wed Jun 26, 2019 9:42 am

Hi,

Ideally you should have started another discussion thread as your post does not seem to be on topic with the current thread plus the curent thread is 4 years old.
You can open a DocBook 5 document in Oxygen, use the "Configure Transformation Scenarios" toolbar button and there should be a DocBook to PDF transformation scenario available.
About the file association question, the installer should ask you at some point during the installation procedure if you want to associate the "xml" extension with Oxygen. Otherwise you can right click in Windows Explorer on the file, choose "Properties", "Opens with..." and you can select the application to open it with.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply