views:

27

answers:

1

Im using the docbook2dita.xsl from the DITA open toolkit (although I had to modify it to xsl version 2.0) To convert my .xml files orginally created in docbook over to DITA now. A weird issue that I'm running into is the tags' contents are not being preserved:

Breadcrumb

<para xreflabel="New Consent Type" id="manageNewConsentType">
<xref linkend="startPage"/>
<xref linkend="middle"/>
<xref linkend="end"/></para>

To:

     <para id="manageNewConsentType">
        <xref href=""/>  
        <xref href=""/>
        <xref href=""/>
     </para>

What should I do to ensure that xrefs and @attribute xreflabel are preserved?

EDIT: Note only some <para> tags have @xreflabel and @id. The ones with these attributes need to be preserved ans well as the xref they contain. But attributeless <para> need to still pass through the docbook2dita.xsl so that if they contains this link media objects which contain an image, these are rightfully transformed to simple <image>

A: 

What should I do to ensure that xrefs and @attribute xreflabel are preserved?

Just ensure that you have the identity rule and that it is selected for processing the <para> element:

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
 <xsl:output omit-xml-declaration="yes" indent="yes"/>

 <xsl:template match="node()|@*">
  <xsl:copy>
   <xsl:apply-templates select="node()|@*"/>
  </xsl:copy>
 </xsl:template>
</xsl:stylesheet>

when this transformation is applied on the provided XML: file:

<para xreflabel="New Consent Type"
      id="manageNewConsentType">
    <xref linkend="startPage"/>
    <xref linkend="middle"/>
    <xref linkend="end"/>
</para>

everything "is preserved":

<para xreflabel="New Consent Type" id="manageNewConsentType">
   <xref linkend="startPage"/>
   <xref linkend="middle"/>
   <xref linkend="end"/>
</para>
Dimitre Novatchev
@Dimitre: Yes I though tit was something like that, but it's not necessarily the case that everything in para needs to be preserved. As shown in " http://stackoverflow.com/questions/3980503/xsl-removing-preceding-folders-on-image-path " <P> can also contain images and stuff.
Ace
@Ace: You haven't stated any requirements about the transformation other than that the xrefs and @attribute xreflabel are preserved. If you want advice with other issues, you need to provide the relevant information.
Dimitre Novatchev
@Dimitre: The question has been more thoroughly documented
Ace
@Ace: Sorry, but I can't understand anything from your question -- in fact this is a typical candidate to be closed. The relevant information for understanding the problem is missing. It is like saying: "I am using someone's program and it is not working. Help!"
Dimitre Novatchev
@Dimitre: Fair enough. I don't understand enough about the transformation process that docbook2dita.xsl is under going. I have reposted this to the Dita Users group, hopefully they have run into this before.
Ace