Page 1 of 1

How-to organize docbook

Posted: Sat Aug 08, 2009 11:12 pm
by twrichter
Hello to all,

now, after 28 days of evaluating ogygenxml I am convinced that this is the right tool for us to use it as manual writing tool.
First I want to buy one XML Editor for me and one XML Author for one of my engineers who is responsible for documentation.
We have a Linux server with Samba over SMB. My engineer is working with Windows using the share "konstruktion" which is mapped to f:. I am using Mac and use Sambe over SMB protocoll.
Our "Standard Head" for our XML docbook file is:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" type="xml"?>
<?xml-stylesheet type="text/xsl" href="/opt/docbook5/GO_manual.xsl"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="de">
Means that we have a Customization file GO_manual.xsl. Until now I was using the evaluation locally on my Mac.
We want to install all of our Manual files on the server in the share "konstruktion".
On Windows: f:/konstruktion/manual1 ..2 ..3 etc. with subdirectories for the graphic files in f:/konstruktion/manual1/pics etc.

Now I have problems:
How do I write the correct href for my Mac OSX?
How do I write the correct href for Windows?
If we have the manual files on the server, how shall we find the pics-Files referring now as

Code: Select all

imagedata fileref="pics/Abbildung2.png" width="350" align="center"/
. How do the system find "/opt/docbook5/GO_manual.xsl"?? Locally or remote? Have I to install the GO_manual.xsl on the share konstruktion in the directory /opt/docbook5/?

Generally how do I organize the files for different systems?? I didn't find any hint in the manual til now...

Regards
Thomas :?:

P.S.: Finally we want to have 1 Editor XML for me and 3 Author for me engineers.

Re: How-to organize docbook

Posted: Mon Aug 10, 2009 4:35 pm
by sorin_ristache
Hello,
twrichter wrote:

Code: Select all

<?xml-stylesheet type="text/xsl" href="/opt/docbook5/GO_manual.xsl"?>
...

How do I write the correct href for my Mac OSX?
How do I write the correct href for Windows?
You can use a URL in the href attribute and resolve the URL on every computer (Mac, Windows, etc) using an XML catalog. The transformation scenario that will specify the stylesheet URL from the href attribute will try to resolve the URL using the XML catalogs added by the user in Preferences -> XML -> XML Catalog. For example you can use:

Code: Select all

<?xml-stylesheet type="text/xsl" href="http://www.me.com/twrichter/GO_manual.xsl"?>
(the URL from the href attribute does not have to point to a valid file on an existing server, it is just a URL resolved using an XML catalog) and specify in an XML catalog:

Code: Select all

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri name="http://www.me.com/twrichter/GO_manual.xsl" uri="/path/to/real/stylesheet/GO_manual.xsl"/>
</catalog>
You have to customize on every computer only the uri attribute of the uri element in the XML catalog used on every machine (Mac, Windows, etc), that is you replace /path/to/real/stylesheet/GO_manual.xsl with the path that is valid on that computer.
twrichter wrote:If we have the manual files on the server, how shall we find the pics-Files referring now as

Code: Select all

imagedata fileref="pics/Abbildung2.png" width="350" align="center"/
If a DocBook XML files specifies a relative path as in your case (pics/Abbildung2.png) the DocBook transformation will resolve this relative path relative to the location of the XML file and pick up the image file from the resulting path. That means if the image file exists in the specified location on the same disk where the XML file exists then you don't have to do anything. Using relative paths in DocBook XML files is the correct approach for including image files.


Regards,
Sorin

Re: How-to organize docbook

Posted: Mon Aug 10, 2009 6:59 pm
by twrichter
Hello Sorin,

thanks for the hints. I will try out (and I will use Webdav to have a "real URL).
By the way:
I used this solution:
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5 ... bookxi.rng" type="xml"?>
<?xml-stylesheet type="text/xsl" href="../docbook5/GO_manual.xsl"?>
<book xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="de">
And I use a special directore "schema":
/Manuals
/Manuals/docbbok5
and in GO_Manual.xsl:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xml:lang="de" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:d="http://docbook.org/ns/docbook"
exclude-result-prefixes="d" version="1.0">
<xsl:import href="docbook/xsl/fo/docbook.xsl"/>
<xsl:import href="GO-titlepage.xsl"/>
and:

Code: Select all

    <!-- Grafikanpassung -->
<xsl:param name="footer.image.filename" select="'../docbook5/images/GOLOGO.png'"/>
<xsl:template match="*" mode="admon.graphic.width">
<xsl:text>24pt</xsl:text>
</xsl:template>
<xsl:param name="admon.graphics.path" select="'../docbook5/images/'"/>
<xsl:param name="admon.graphics.extension">.png</xsl:param>
<xsl:param name="admon.graphics" select="1"/>

(havind deactivated the path parameter in oxygenxml).

Advantage: I do not need to customize the uri attribute on each machine. Disadvantage?? -- don't know.

When I use a webdav file system, even the special directory structure isn't necessary.

Regards and thx
Thomas