DITA Metrics Report: need @conkeyref support

Here should go questions about transforming XML with XSLT and FOP.
lief.erickson
Posts: 14

DITA Metrics Report: need @conkeyref support

Sun Mar 01, 2015 7:50 pm

Hello--

The DITA Metrics report provides a lot good information, but it's incomplete. It does not provide reuse statistics for any @conkeyref. I'd like to add support for that. (Even better would be if oXygen had default support for it. I know others would like to see it, too. http://www.oxygenxml.com/pipermail/oxygen-user/2013-October/004799.html)

I have been able to enhance the files in frameworks\dita\report to show me how many @conkeyref are used and what elements they appear in. What I can't figure out is how to "gather all the key definitions that form the keyspace - these can be placed in a variable that is used then to lookup for the corresponding node in the resolve.xsl stylesheet when we match on an element having a conkeyref on it" as George Bina wrote in the above post from October 2013. I'm guessing that if this were easy oXygen would already have this support.

Is there template or stylesheet that someone could point me to that might give me some hints on how to do this?

-Lief
george
Site Admin
Posts: 2100

Re: DITA Metrics Report: need @conkeyref support

Tue Mar 03, 2015 1:19 am

Hi Lief,

Well, it is not that difficult... I just implemented support for determining the key space and handling topicref/@keyref and @conkeyref and this will be generally available in the next oXygen release. If you need this now please contact us directly at support@oxygenxml.com and I will send you the updated XSLT scripts.

Best Regards,
George
George Cristian Bina
lief.erickson
Posts: 14

Re: DITA Metrics Report: need @conkeyref support

Tue Mar 03, 2015 2:29 am

A message has been sent. Thanks, George.
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Wed Jun 15, 2016 6:08 pm

Hi George,

Is this feature already implemented in oXygen 16?

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
george
Site Admin
Posts: 2100

Re: DITA Metrics Report: need @conkeyref support

Thu Jun 16, 2016 2:48 pm

Hi Frank,

I think I implemented this in 18.0 or 17.1 - I do not remember exactly - just update to version 18 and you should have it there.

Regards,
George
George Cristian Bina
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Thu Jun 16, 2016 4:03 pm

Hi George,

Thanks for this information. Our client is still on oXygen 16.1 but I will have a look in oXygen 17 or 18.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Thu Jun 16, 2016 4:33 pm

It's there in oXygen 17.1, in Oxygen XML Editor 17\frameworks\dita\report\report.xsl

Code: Select all

 
 <!-- CONKEYREFs -->
    <xsl:template match="*[@conkeyref]" mode="resolve-base resolve">
        <xsl:param name="keyspace" tunnel="yes"/>
        <xsl:variable name="key" select="if (contains(@conkeyref, '/')) then substring-before(@conkeyref, '/') else @conkeyref"/>
        <xsl:variable name="elementID" select="substring-after(@conkeyref, '/')"/>
        <xsl:variable name="keydef" select="$keyspace/oxyd:keyspace/oxyd:key[@value=$key]"/>
        <xsl:variable name="topicFile" select="$keydef/*[1]/document(@href, .)"/>
        <oxyd:conref element="{name()}" key="{$key}">
            <xsl:attribute name="xml:base" select="document-uri($topicFile)"/>
            <xsl:apply-templates select="if ($elementID = '') then $topicFile/* else $topicFile//*[@id=$elementID]" mode="#current"/>
        </oxyd:conref>
    </xsl:template>


Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Thu Jun 16, 2016 4:37 pm

EDIT:

The above code resides in Oxygen XML Editor 17\frameworks\dita\report\modules\resolve.xsl

Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Thu Jun 16, 2016 5:21 pm

I've just created a report from the same DITA map with the oXygen 16.1 and oXygen 17.1 versions of the report script. I don't quite understand the results because the oXygen 17 version reports more reused elements (because of the @conkeyref'ed elements) and words but a lover reuse percentage. How can that be?

Frank

Content reuse - oXygen 16 - without @conkeyref
Total reused words (words in conref content) 52,328. Content reuse percentage (words) is 24.74%.
Total reused elements (elements in conref content) 11,464. Elements reuse percentage is 9.13%.
Total content reference elements 27.


Content reuse - oXygen 17 - with @conkeyref
Total reused words (words in conref content) 52,511. Content reuse percentage (words) is 22.19%.
Total reused elements (elements in conref content) 11,784. Elements reuse percentage is 7.85%.
Total content reference elements 334.
Frank Ralf
parson AG
www.parson-europe.com
george
Site Admin
Posts: 2100

Re: DITA Metrics Report: need @conkeyref support

Mon Jun 20, 2016 4:04 pm

Hi Frank,

You need to check the "Total words" value and the "Total topic elements" - these are the values that represent 100% of words and topic elements, respectively.

Best Regards,
George
George Cristian Bina
Frank Ralf
Posts: 367
Location: Hamburg

Re: DITA Metrics Report: need @conkeyref support

Tue Jul 05, 2016 2:41 pm

Hi George,

Thanks for the clarification.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 0 guests