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!
DocBook files to TXT
-
- Posts: 2
-
- Posts: 4144
Re: DocBook files to TXT
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:
Regards,
Sorin
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
-
- Posts: 2
Re: DocBook files to TXT
Thank you, Sorin!
Nice and simple, and does exactly what I want.
Kurt
Nice and simple, and does exactly what I want.
Kurt
Who is online
Users browsing this forum: No registered users and 0 guests