How to filter the dita file on the basis of the value of an attribute.

Here should go questions about transforming XML with XSLT and FOP.
shiney_98
Posts: 12
Joined: Thu Sep 09, 2021 12:03 pm

How to filter the dita file on the basis of the value of an attribute.

Post by shiney_98 »

How to filter the dita file on the basis of the value of an attribute so that intermediateXMl has only specified topics.

Suppose I have an attribute named product with the value of true and false in oxygen editor. I apply both product = true and product = false for two different topics.

While publishing the bookmap with these two topics, I want the intermediateXMl.xml file to show only the topic content with the attribute value "product=true" and remove the other topic which has the attribute value "product=false"

Is there a way to describe a code in xsl for this scenario to be added in dita-to-intermediate.xsl
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: How to filter the dita file on the basis of the value of an attribute.

Post by Radu »

Hi,

The DITA standard indeed defines a set of profiling attributes:
https://www.oxygenxml.com/dita/1.3/spec ... dproc.html
It also defines the contents of a "DITAVAL" filter file which can be used to filter content based on those attributes:
https://www.oxygenxml.com/dita/1.3/spec ... l-val.html
Most of the times DITA content is published using a tool named the "DITA Open Toolkit". Oxygen comes bundled with a customized DITA Open Toolkit but you can also download it as it is an open source project. And when publishing using the DITA Open Toolkit there is a "filter" stage during publication which applies the DITAVAL filter file over the DITA content and removes excluded content.
If you are publishing DITA content from Oxygen using its bundled DITA Open Toolkit publishing engine there are two past webinar recordings here about profiling:
https://www.oxygenxml.com/working_with_ ... xygen.html
If you are using your own custom XSLT stylesheet and apply it directly on DITA content I guess you need to re-implement profiling with your own code.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply