DITA Metrics Report: need @conkeyref support
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
DITA Metrics Report: need @conkeyref support
Post by lief.erickson »
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/oxyg ... 04799.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
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/oxyg ... 04799.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
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: DITA Metrics Report: need @conkeyref support
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
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
-
- Posts: 17
- Joined: Sun Mar 01, 2015 8:26 am
Re: DITA Metrics Report: need @conkeyref support
Post by lief.erickson »
A message has been sent. Thanks, George.
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
Hi George,
Is this feature already implemented in oXygen 16?
Best regards,
Frank
Is this feature already implemented in oXygen 16?
Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: DITA Metrics Report: need @conkeyref support
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
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
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
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
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
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
It's there in oXygen 17.1, in Oxygen XML Editor 17\frameworks\dita\report\report.xsl
Frank
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 Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
EDIT:
The above code resides in Oxygen XML Editor 17\frameworks\dita\report\modules\resolve.xsl
Frank
The above code resides in Oxygen XML Editor 17\frameworks\dita\report\modules\resolve.xsl
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
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
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
parson AG
www.parson-europe.com
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: DITA Metrics Report: need @conkeyref support
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
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
-
- Posts: 482
- Joined: Thu Jan 23, 2014 2:29 pm
- Location: Hamburg
- Contact:
Re: DITA Metrics Report: need @conkeyref support
Post by Frank Ralf »
Hi George,
Thanks for the clarification.
Kind regards,
Frank
Thanks for the clarification.
Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
parson AG
www.parson-europe.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ 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