topic merge


Ilana Kingsley <indexpup@...>
 

Hi Folks,

I have a couple of questions about topicmerge.xsl and how to use it.

I have two .xml files, lets say a.xml and b.xml.
I want these files to be chunked, so I create a file named mychunks.ditamap, which contains the following:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map SYSTEM "file:///C:/dita3/dtd/map.dtd">
<map title="test">
<topicref href="a.xml" type="concept" title="21727" >
<topicref href="b.xml" type="concept" title="test" navtitle="test" />
</topicref>
</map>

I run the transform java com.icl.saxon.StyleSheet -o index.html map.ditamap C:/dita/dita13/xsl/map2html.xsl

and get two files, once called a.xml and the other b.xml.

Great. This is what I wanted. But now I want to merge the topics.
I follow the instructions in MAP-README.txt:

I run java com.icl.saxon.StyleSheet -o index.html map.ditamap C:/dita/dita13/xsl/xsl/topicmerge.xsl > merged-map1.xml

and the file index.html is created, however, when I look at the source code it's not html source -- it's just the xml. So, I try running
java com.icl.saxon.StyleSheet -o index.html merged-map1.xml C:/dita/dita13/xsl/map2html.xsl

but I don't get the desired result, which is an index.html page that contains info from a.xml and b.xml.

What am I missing?

--Ilana

http://stinkypup.net
http://members.petfinder.org/~AK17/index.php
http://www.indexpup.com


France Baril <france.baril@...>
 

LLana, you are right when you try to use topicmerge.xsl to create a single html page document. Merging all documents together creates a multi-topic dita file, that could after be used to create a single html document. The only problem here is that no stylesheet was created to produce a single html page from a DITA document, they all create html pages for topics.

If you were to use topicmerge.xsl and then dita2fo_shell.xsl and an fo processor, you would obtain a single document (a pdf for example) because this dita2fo_shell.xsl was created for outputting a single file from a dita document.

Basically, you are at the point where you would need to create a new stylesheet to get what you want.

France

-----Original Message-----
From: Ilana Kingsley [mailto:indexpup@indexpup.com]
Sent: Thu 8/26/2004 8:56 PM
To: dita-users@yahoogroups.com
Cc:
Subject: [dita-users] topic merge


Hi Folks,

I have a couple of questions about topicmerge.xsl and how to use it.

I have two .xml files, lets say a.xml and b.xml.
I want these files to be chunked, so I create a file named
mychunks.ditamap, which contains the following:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map SYSTEM "file:///C:/dita3/dtd/map.dtd">
<map title="test">
<topicref href="a.xml" type="concept" title="21727" >
<topicref href="b.xml" type="concept" title="test" navtitle="test" />
</topicref>
</map>

I run the transform java com.icl.saxon.StyleSheet -o index.html
map.ditamap C:/dita/dita13/xsl/map2html.xsl

and get two files, once called a.xml and the other b.xml.

Great. This is what I wanted. But now I want to merge the topics.
I follow the instructions in MAP-README.txt:

I run java com.icl.saxon.StyleSheet -o index.html map.ditamap
C:/dita/dita13/xsl/xsl/topicmerge.xsl > merged-map1.xml

and the file index.html is created, however, when I look at the source
code it's not html source -- it's just the xml. So, I try running
java com.icl.saxon.StyleSheet -o index.html merged-map1.xml
C:/dita/dita13/xsl/map2html.xsl

but I don't get the desired result, which is an index.html page that
contains info from a.xml and b.xml.

What am I missing?

--Ilana

http://stinkypup.net
http://members.petfinder.org/~AK17/index.php
http://www.indexpup.com


Yahoo! Groups Sponsor
ADVERTISEMENT
click here <http://us.ard.yahoo.com/SIG=129sqajus/M=295196.4901138.6071305.3001176/D=groups/S=1706030390:HM/EXP=1093672616/A=2128215/R=0/SIG=10se96mf6/*http://companion.yahoo.com>
<http://us.adserver.yahoo.com/l?M=295196.4901138.6071305.3001176/D=groups/S=:HM/A=2128215/rand=376208846>


_____

Yahoo! Groups Links


* To visit your group on the web, go to:
http://groups.yahoo.com/group/dita-users/

* To unsubscribe from this group, send an email to:
dita-users-unsubscribe@yahoogroups.com <mailto:dita-users-unsubscribe@yahoogroups.com?subject=Unsubscribe>

* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> .


Don Day <dond@...>
 

Ilana Kingsley <indexpup@indexpup.com> wrote on 08/26/2004 07:56:11 PM:

I have a couple of questions about topicmerge.xsl and how to use it.

I have two .xml files, lets say a.xml and b.xml.
I want these files to be chunked, so I create a file named
mychunks.ditamap, which contains the following:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map SYSTEM "file:///C:/dita3/dtd/map.dtd">
<map title="test">
<topicref href="a.xml" type="concept" title="21727" >
<topicref href="b.xml" type="concept" title="test" navtitle="test" />
</topicref>
</map>

I run the transform java com.icl.saxon.StyleSheet -o index.html
map.ditamap C:/dita/dita13/xsl/map2html.xsl

and get two files, once called a.xml and the other b.xml.
You probably meant "a.html" and "b.html" as well as an empty "index.html".
The index file is not really meaningful when using the map2html transform.
All this transform does is traverse the map and turn each referenced topic
into an individual HTML result file, and nothing is actually built as a
direct output for the -o file. If instead you invoke the
map2WebHTMLTOC.xsl transform, you will get a more conventional index.html
result file that contains links to the separate a.html and b.html files.
We need to do a better job at documenting these calling interfaces and
their expected outputs.

Great. This is what I wanted. But now I want to merge the topics.
I follow the instructions in MAP-README.txt:

I run java com.icl.saxon.StyleSheet -o index.html map.ditamap
C:/dita/dita13/xsl/xsl/topicmerge.xsl > merged-map1.xml
The redirect ("> merged-map1.xml") produced an empty file because the
output was already defined to the process by the "-o index.html" parameter.
The resulting index.html, although misnamed, does indeed contain the result
of merging the two separate DITA concepts into a single entity, still in
DITA XML format. That is the whole purpose of topicmerge... it creates a
single chunk following the hierarchy and sequence given in the map. From
here on, the map is out of the picture; it has done its job, and we deal
with the merged file from here on.

Based on this info, the previous command for merging the map and its topics
into a single, hierarchically organized unit would be thus:

D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o merged-map1.xml map.ditamap
../xs
l/topicmerge.xsl

and the file index.html is created, however, when I look at the source
code it's not html source -- it's just the xml.
Right! Because what topicmerge produces is a merged intermediate file that
has the structure of the map and the content of the topics referenced by
the topicrefs. This is exactly the expected result so far.

So, I try running
java com.icl.saxon.StyleSheet -o index.html merged-map1.xml
C:/dita/dita13/xsl/map2html.xsl

but I don't get the desired result, which is an index.html page that
contains info from a.xml and b.xml.

What am I missing?
Now that we have a merged intermediate file, we no longer process it as map
(the map was absorbed into the intermediate file by doing the topicmerge)
but rather as a compound topic, which for our purposes will be served by
invoking either topic2html.xsl (the basic transform set) or
dita2html_shell.xsl (this set includes all overrides for domains, task,
etc.).

D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o index.html merged-map1.xml
../xsl/
topic2html.xsl

or

D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o index.html merged-map1.xml
../xs
l/dita2html_shell.xsl

Now the resulting index.html depicts the merged and nested topics indicated
by the original hierarchy of your map.

Regards,
--
Don Day
IBM Lead DITA Architect


Don R. Day <dond@...>
 

I see some naming discrepancies between your files and my examples,
so to make certain that my examples match your filenames, I've
renamed my test files and re-run the examples with new result names
that don't overwrite previous results.

Given that you have these source files in a subdirectory &#92;test:
mychunks.ditamap (based on the example in your posting)
a.xml (simple test concept)
b.xml (another simple test concept)

Scenario 1. Produce a fully linked Web page view:
D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o index.html
mychunks.ditamap ../xsl/map2WebHTMLTOC.xsl

Result files:
index.html (if you used map2html.xsl, this file would be empty)
a.html
b.html

Note 1: Both result pages will have top-level headings since the
hierarchy is in the map instead of in the instances.

Note 2: It is not wrong to use map2html.xsl as long as you know that
all it is doing is basic topic-to-webpage conversion, period.

Scenario 2. Produce an intermediate merged result
D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o merged-map1.xml
mychunks.ditamap ../xsl/topicmerge.xsl

Result file:
merged-map1.xml (contains both topics nested according to the map)

At this point, it seems that you wanted to transform the merged set
using topic2html and get a single HTML view of that merged set. The
documentation is vague about this, but in fact the tools work just
fine for this case. From here on, the transforms will be run against
this intermediate file of merged topics.

Scenario 3. Process the merged files using the base or default
transforms:
D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o index1.html
merged-map1.xml ../xsl/topic2html.xsl

Result file:
index1.html

Note: This single file shows the content of both topics, and now the
headings showing the appropriate size for nesting level, as indicated
by the original map.

Scenario 4. Process the merged files using the full set of transforms:
D:&#92;dita13&#92;test>java com.icl.saxon.StyleSheet -o index2.html
merged-map1.xml ../xsl/dita2html_shell.xsl

Result file:
index2.html

Note: This will appear the same as index1.html, but some of the
content might be different if it contained tasks or the use of domain
elements that have special processing.

As France Baril indicated in her note, you can also run any of the FO
transforms against the merged file and get similar PDF results.

Regards,
--
Don Day
IBM Lead DITA Architect