Docbook 5 to webhelp: using folders
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 6
- Joined: Fri Dec 16, 2011 2:04 pm
Docbook 5 to webhelp: using folders
Hi,
I am trying to create a proyect where xml files are distributed through some folders. When I try to transform it using the docbook5 to Webhelp predefined scenario, I get a wrong result. As an example, I attach a main.xml that calls a intro2.xml file, stored in the sub folder:
Sincerely,
Fran Pena
I am trying to create a proyect where xml files are distributed through some folders. When I try to transform it using the docbook5 to Webhelp predefined scenario, I get a wrong result. As an example, I attach a main.xml that calls a intro2.xml file, stored in the sub folder:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<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">
<title>book</title>
<part>
<title>First Part</title>
<xi:include href="sub/intro2.xml"/>
</part>
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<chapter 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">
<title>Chapter Title</title>
<sect1><title>Sect1 Title</title>
<para>Text</para>
</sect1>
</chapter>
Fran Pena
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Docbook 5 to webhelp: using folders
Hi Fran,
What do you mean exactly by "wrong result"?
We tried to produce WebHelp output from your small samples and the result looked OK.
Regards,
Radu
What do you mean exactly by "wrong result"?
We tried to produce WebHelp output from your small samples and the result looked OK.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Fri Dec 16, 2011 2:04 pm
Re: Docbook 5 to webhelp: using folders
Hi Radu,
sorry for the mistake! The intro2.xml that I have should attached is:
In this file, the image "images/example001.png" is used. I stored this image in ./sub/images, but the image does not appear in the webhelp (that's why I said "wrong").
I have realized that the webhelp is correct if I store the image in ./images (not in ./sub/images). The problem is that I would like to have a lot o subfolders (since I have a lot of chapters) and I would like to store the images related to each chapter in the same subfolder where the xml files are.
Sincerely,
Fran
sorry for the mistake! The intro2.xml that I have should attached is:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<chapter 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">
<title>Chapter Title</title>
<sect1>
<title>Section1 Title</title>
<para>
AAAAAAAAAAAA
<inlinemediaobject><imageobject><imagedata fileref="images/example001.png"/></imageobject></inlinemediaobject>
AAAAAAAAAAAA
</para>
</sect1>
</chapter>
I have realized that the webhelp is correct if I store the image in ./images (not in ./sub/images). The problem is that I would like to have a lot o subfolders (since I have a lot of chapters) and I would like to store the images related to each chapter in the same subfolder where the xml files are.
Sincerely,
Fran
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Docbook 5 to webhelp: using folders
Hi Fran,
The ANT build file which manages the WebHelp output can be found here:
OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/webhelp/build.xml
It does not have a very smart approach with regard to image references, basically it searches for a folder called images in the main Docbook folder and copies it to the output directory without any additional changes. If you want some other type of handling for images you will have to modify the ANT tasks yourself.
So based on what is written here:
http://www.sagehill.net/docbookxsl/ModularDoc.html
In my opinion the best for you would be to keep a single "images" folder in the root folder (where the main Docbook XML is located) and then in the XI:included modules add an xml:base="../" attribute on the root element, thus having all relative references in the module files interpreted relative to the main parent Docbook directory.
Or you could keep all modules + the main XML file in the same directory of course.
I think you should also write about this situation on the Docbook Users List, they might have better approaches for you.
Regards,
Radu
The ANT build file which manages the WebHelp output can be found here:
OXYGEN_INSTALL_DIR/frameworks/docbook/xsl/webhelp/build.xml
It does not have a very smart approach with regard to image references, basically it searches for a folder called images in the main Docbook folder and copies it to the output directory without any additional changes. If you want some other type of handling for images you will have to modify the ANT tasks yourself.
So based on what is written here:
http://www.sagehill.net/docbookxsl/ModularDoc.html
The default behavior is to keep the path to the image unchanged in the resulting HTML document (and disregard the fact that the module will actually be part of a larger document with a different base URL).A relative fileref processed with XInclude and with keep.relative.image.uris="1" is always copied without change (this is the default setting for HTML output).
In my opinion the best for you would be to keep a single "images" folder in the root folder (where the main Docbook XML is located) and then in the XI:included modules add an xml:base="../" attribute on the root element, thus having all relative references in the module files interpreted relative to the main parent Docbook directory.
Or you could keep all modules + the main XML file in the same directory of course.
I think you should also write about this situation on the Docbook Users List, they might have better approaches for you.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service