I've created a conversion process to take DITA to asciidoc that works
pretty well overall. What I have is:
- a folder with all the dita, ditamaps, and images in a flat structure
- a simplified format of the map as run through the normalize process
I use the simplified map to determine what files and how they should be
organized in the final output. This map also contains information about
images, xrefs and conref content (linked to content).
My problem is that the simplified map is based upon files that are in
the TOC. We have some situations where the writer has referenced topics
that are not in the TOC.
I want to run a list of all the dita files as a collection and another
list of images as a collection so I can compare these to the entries in
the map. The process works well for the dita content with this:
<xsl:variable name="rawditacollectionString"
select="concat($rawsrcPath, '?select=(*.dita|*.xml)')"/>
<xsl:for-each-group select=" $STRUCTURE//xref" group-by="@file">
<!-- Match each XREF to a TOPIC entry in $STRUTURE, if no match, it is
an
orphan -->
<xsl:variable name="FILE" select="current-grouping-key()"/>
<xsl:choose>
<xsl:when test="$STRUCTURE//topic[@file=$FILE]">
<!--Found <xsl:value-of select="$FILE"/>-->
</xsl:when>
<xsl:otherwise>
<file file="{$FILE}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each-group>
I'm shifting to the images and tried to use the same configuration for
images. Problem is that base-uri() wants an XML file
The required item type of the first argument of fn:base-uri() is node();
the supplied value xs:base64Binary("") is an atomic value
Is there anything I can use directly in XSL (this one stylesheet) that
will just give me the filenames of these images? I can do some other
preprocessing stages and build an xml file with all these images listed,
but I would prefer to do this in this one stylesheet that is doing all
of this heavy lifting and decision making.
..dan