Getting olink working in DocBook 5
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 5
- Joined: Thu Sep 22, 2016 7:59 pm
Getting olink working in DocBook 5
Hi,
I have an evaluation copy of XML Author and I'm trying to get olink working but I'm getting the error "F [Saxon6.5.5] A DOCTYPE is not allowed in content." in target.db.
Here are the custom parameters in my xsl:
Here is the target.db (which is generated automatically):
Here is olinkdb.xml:
Here is my main document, manual.xml:
Here is the included document, second.xml:
And here is the bibliography, bib.xml:
I have an evaluation copy of XML Author and I'm trying to get olink working but I'm getting the error "F [Saxon6.5.5] A DOCTYPE is not allowed in content." in target.db.
Here are the custom parameters in my xsl:
Code: Select all
bibliography.collection '${cfdu}/jabref.xml'
bibliography.numbered '1'
collect.xref.targets 'yes'
html.ext 'xhtml'
section.autolabel '1'
section.label.includes.component.label '1'
target.database.document '${cfdu}/olinkdb.xml'
targets.filename '${pd}/target.db'
Code: Select all
<!DOCTYPE div
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<div element="book" href="#manual" number="" targetptr="manual">
<ttl>Manual</ttl>
<xreftext>Manual</xreftext>
<div element="chapter" href="#secondCh" number="1" targetptr="secondCh">
<ttl>Second</ttl>
<xreftext>Chapter 1, <em xmlns="http://www.w3.org/1999/xhtml">Second</em></xreftext>
</div>
<div element="bibliography" href="#bib" number="" targetptr="bib">
<ttl>Bibliography</ttl>
<xreftext>Bibliography</xreftext>
<obj element="bibliomixed" href="#Duan2016" number="" targetptr="Duan2016">
<ttl>???TITLE???</ttl>
<xreftext>1</xreftext>
</obj>
<obj element="bibliomixed" href="#Pierce2016" number="" targetptr="Pierce2016">
<ttl>???TITLE???</ttl>
<xreftext>2</xreftext>
</obj>
</div>
</div>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetset SYSTEM "file:/C:/Program%20Files/Oxygen%20XML%20Author%2018/frameworks/docbook/xsl/common/targetdatabase.dtd" [
<!ENTITY manualTargets SYSTEM "file:/S:/Examples/WordReplacement/DocBook/target.db">
]>
<targetset>
<targetsetinfo> Description of this target database document. </targetsetinfo>
<!-- Site map for generating relative paths between documents -->
<sitemap>
<dir name="out">
<dir name="xhtml">
<document targetdoc="manual" baseuri="manual.xhtml">&manualTargets;</document>
</dir>
</dir>
</sitemap>
</targetset>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<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:id="manual">
<info>
<title>Manual</title>
<author>
<orgname>Musculoskeletal Research Laboratories</orgname>
<address>
<street>50 S. Central Campus Drive</street>
<city>Salt Lake City</city>
<state>Utah</state>
<postcode>84112</postcode>
</address>
</author>
</info>
<!--<xi:include href="first.xml"/>-->
<xi:include href="second.xml"/>
<xi:include href="bib.xml"/>
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="secondCh">
<title>Second</title>
<para>Here is a citation reference <olink targetdoc="bib" targetptr="Duan2016"/></para>
</chapter>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<bibliography xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="bib">
<bibliomixed xml:id="Duan2016"></bibliomixed>
<bibliomixed xml:id="Pierce2016"></bibliomixed>
</bibliography>
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Getting olink working in DocBook 5
Post by radu_pisoi »
Hi,
I think the problem is the DOCTYPE declaration specified in the 'target.db' file. That prevented a target database from using a system entity reference to pull in the target.db files.
Please see the Docbook issue:
https://sourceforge.net/p/docbook/bugs/1217/
Could you try to remove the DOCTYPE declaration from the 'target.db' file and try the transformation again?
I think the problem is the DOCTYPE declaration specified in the 'target.db' file. That prevented a target database from using a system entity reference to pull in the target.db files.
Please see the Docbook issue:
https://sourceforge.net/p/docbook/bugs/1217/
Could you try to remove the DOCTYPE declaration from the 'target.db' file and try the transformation again?
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 5
- Joined: Thu Sep 22, 2016 7:59 pm
Re: Getting olink working in DocBook 5
I changed from xhtml to html and that got rid of the DOCTYPE in target.db. Here's my new target.db:
Why does it have the <ttl/><xreftext/> after the first div tag? The olinkdb.xml file is also throwing the error that "Element type 'i' must be declared." for this file.
Here is the olinkdb.xml file:
These documents will be worked on by several collaborators on different operating systems so I'm wondering if the targetdatabase.dtd is available online? If not, is there a way to specify a user variable for the path to the dtd?
Here is the updated manual2.xml file:
And here is the bib2.xml file:
I'm now getting the error: "[Saxon6.5.5] Error: unresolved olink: targetdoc/targetptr = 'bib2/Duan2016'" for the olink in manual2.xml.
Code: Select all
<div element="book" href="#manual2" number="" targetptr="manual2"><ttl/><xreftext/>
<div element="chapter" href="#d5e2" number="1">
<ttl>First Chapter</ttl>
<xreftext>Chapter 1, <i>First Chapter</i></xreftext>
<div element="sect1" href="#d5e4" number="1.1">
<ttl>First Section</ttl>
<xreftext>Section 1.1, “First Section”</xreftext>
</div>
</div>
<div element="bibliography" href="#bib2" number="" targetptr="bib2">
<ttl>Bibliography</ttl>
<xreftext>Bibliography</xreftext>
<obj element="bibliomixed" href="#Duan2016" number="" targetptr="Duan2016">
<ttl>???TITLE???</ttl>
<xreftext>1</xreftext>
</obj>
<obj element="bibliomixed" href="#Pierce2016" number="" targetptr="Pierce2016">
<ttl>???TITLE???</ttl>
<xreftext>2</xreftext>
</obj>
</div>
</div>
Here is the olinkdb.xml file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE targetset SYSTEM "file:/C:/Program%20Files/Oxygen%20XML%20Author%2018/frameworks/docbook/xsl/common/targetdatabase.dtd" [
<!ENTITY manual2Targets SYSTEM "target.db">
]>
<targetset>
<targetsetinfo> Description of this target database document. </targetsetinfo>
<!-- Site map for generating relative paths between documents -->
<sitemap>
<dir name="out">
<dir name="xhtml">
<document targetdoc="manual2" baseuri="manual.xhtml">&manual2Targets;</document>
</dir>
</dir>
</sitemap>
</targetset>
Here is the updated manual2.xml file:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbookxi.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<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:id="manual2">
<chapter>
<title>First Chapter</title>
<sect1>
<title>First Section</title>
<para>Here's a link <olink targetdoc="bib2" targetptr="Duan2016"/></para>
</sect1>
</chapter>
<xi:include href="bib2.xml"/>
</book>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<bibliography xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="bib2">
<bibliomixed xml:id="Duan2016"></bibliomixed>
<bibliomixed xml:id="Pierce2016"></bibliomixed>
</bibliography>
-
- Posts: 5
- Joined: Thu Sep 22, 2016 7:59 pm
Re: Getting olink working in DocBook 5
I added a second included document, chapter2.xml, and figured out the olink targetdoc needs to be "manual2" instead of "bib2". That solved the olink problem.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="http://docbook.org/xml/5.0/rng/docbook.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="secondCh">
<title>Second Chapter</title>
<para>And here's another link <olink targetdoc="manual2" targetptr="Pierce2016"/></para>
</chapter>
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