{"id":55524,"date":"2022-09-27T13:30:30","date_gmt":"2022-09-27T08:00:30","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=55524"},"modified":"2024-08-23T13:04:58","modified_gmt":"2024-08-23T07:34:58","slug":"xml-add-on-conditional-filtered-dita-content-output-in-aem","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/xml-add-on-conditional-filtered-dita-content-output-in-aem\/","title":{"rendered":"XML Add On &#8211; Conditional\/Filtered DITA content output in AEM"},"content":{"rendered":"<p><strong>Use cases<\/strong><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Let&#8217;s assume we have a large number of published articles or topics. Each article contains some paragraphs or content that is obsolete now and should not be displayed to the end users. Since the number of articles is large, it is difficult to update the content quickly.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Let&#8217;s say we have all content ready, but this needs to be released in a phased manner.<\/span><\/li>\n<\/ul>\n<p><strong>Solution<\/strong><br \/>\nTo achieve these kinds of requirements we can utilise the <a href=\"https:\/\/help.adobe.com\/en_US\/xml-documentation-for-adobe-experience-manager\/index.html#t=DXML-master-map%2Fid17C5E0U0OQE.html%23id17C5E0U0OQE&amp;rhtocid=_3_1_2\"><span style=\"font-weight: 400;\">DITAVAL editor<\/span><\/a>. Using <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a><\/p>\n<ul>\n<li><span data-preserver-spaces=\"true\">Content editors or authors can set conditions on a piece of content to control whether it is displayed in the final output.<\/span><\/li>\n<li><span data-preserver-spaces=\"true\">Content editors can choose upon publication to show\/hide different conditions.\u00a0<\/span><\/li>\n<\/ul>\n<p><strong>Set the conditions in the topics<\/strong><\/p>\n<ul>\n<li>Open the topic for editing and add all the required content to it.<\/li>\n<li>Select or put the cursor inside a particular element and add the required attributes and values from the right side. Refer to the following snapshots.<\/li>\n<li>Save the content.<\/li>\n<\/ul>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55512\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-300x159.png\" alt=\"\" width=\"966\" height=\"512\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-1024x543.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-768x407.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-1536x815.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-2048x1086.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.38.11-AM-624x331.png 624w\" sizes=\"(max-width: 966px) 100vw, 966px\" \/><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55513\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-300x160.png\" alt=\"\" width=\"964\" height=\"514\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-300x160.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-1024x547.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-768x410.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-1536x821.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-2048x1094.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.37.21-AM-624x333.png 624w\" sizes=\"(max-width: 964px) 100vw, 964px\" \/><\/p>\n<p>As shown in the above screenshots the first paragraph is added with the audience as internal and the second paragraph with the audience as external.<\/p>\n<p><strong>Creating or editing DITAVAL file<\/strong><br \/>\nTo create or update the <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> file follow the steps mentioned in the <a href=\"https:\/\/help.adobe.com\/en_US\/xml-documentation-for-adobe-experience-manager\/index.html#t=DXML-master-map%2Fid17C5E0U0OQE.html%23id17C5E0U0OQE&amp;rhtocid=_3_1_2\"><span style=\"font-weight: 400;\">DITAVAL editor<\/span><\/a> documentation.<br \/>\nIn our use case the following two DITAVAL files are created.<br \/>\n<em><br \/>\n<strong>Internal<\/strong><\/em><br \/>\nAuthor View<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55516\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-300x162.png\" alt=\"\" width=\"959\" height=\"518\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-300x162.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-768x416.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-1536x832.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-2048x1109.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.26-AM-624x338.png 624w\" sizes=\"(max-width: 959px) 100vw, 959px\" \/><\/p>\n<p>Source View<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55517\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.51-AM-300x156.png\" alt=\"\" width=\"956\" height=\"497\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.51-AM-300x156.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.56.51-AM-624x325.png 624w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/p>\n<p><strong><em>External<\/em><\/strong><br \/>\nAuthor View<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55518\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.27-AM-300x158.png\" alt=\"\" width=\"956\" height=\"503\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.27-AM-300x158.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.27-AM-624x329.png 624w\" sizes=\"(max-width: 956px) 100vw, 956px\" \/><\/p>\n<p>Source View<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55519\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-300x157.png\" alt=\"\" width=\"952\" height=\"498\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-300x157.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-1024x535.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-768x401.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-1536x803.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-2048x1070.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-11.57.43-AM-624x326.png 624w\" sizes=\"(max-width: 952px) 100vw, 952px\" \/><\/p>\n<p><strong>Include these <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> files in a publishing <a href=\"https:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/archSpec\/definition-of-ditamaps.html\"><span style=\"font-weight: 400;\">DITA map<\/span><\/a> and generate the output<\/strong><\/p>\n<p><strong><em>Inclusion of internal <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> file<\/em><\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55520\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-300x154.png\" alt=\"\" width=\"942\" height=\"484\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-300x154.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-1024x527.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-768x395.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-1536x790.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-2048x1054.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.11-PM-624x321.png 624w\" sizes=\"(max-width: 942px) 100vw, 942px\" \/><\/p>\n<p>Final content output<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55522\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-300x130.png\" alt=\"\" width=\"936\" height=\"406\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-300x130.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-1024x444.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-768x333.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-1536x666.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-2048x887.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.14.49-PM-624x270.png 624w\" sizes=\"(max-width: 936px) 100vw, 936px\" \/><\/p>\n<p>Here we can notice that external content is not available in the page as this was excluded in the internal DITAVAL file.<\/p>\n<p><strong><em>Inclusion of external <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> file<\/em><\/strong><\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55521\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-300x158.png\" alt=\"\" width=\"935\" height=\"492\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-300x158.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-1024x540.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-768x405.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-1536x810.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-2048x1080.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.00.47-PM-624x329.png 624w\" sizes=\"(max-width: 935px) 100vw, 935px\" \/><\/p>\n<p>Final content output<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-55523\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-300x140.png\" alt=\"\" width=\"934\" height=\"436\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-300x140.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-1024x479.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-768x359.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-1536x718.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-2048x957.png 2048w, \/blog\/wp-ttn-blog\/uploads\/2022\/09\/Screenshot-2022-09-24-at-12.18.52-PM-624x292.png 624w\" sizes=\"(max-width: 934px) 100vw, 934px\" \/><\/p>\n<p>Here we can notice that internal content is not available in the page as this was excluded in the external <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> file.<\/p>\n<p><strong>Conclusion<\/strong><br \/>\nAs we can see, although all the content is available in the original topics, the content is excluded based on what conditional elements are used in the <a href=\"http:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval\"><span style=\"font-weight: 400;\">DITAVAL<\/span><\/a> file. So we can achieve similar scenarios using conditional processing.<\/p>\n<p><strong>References<\/strong><br \/>\nhttp:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/common\/about-ditaval.html#ditaval<br \/>\nhttp:\/\/docs.oasis-open.org\/dita\/v1.2\/os\/spec\/archSpec\/conditional-processing-attributes.html<\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Use cases Let&#8217;s assume we have a large number of published articles or topics. Each article contains some paragraphs or content that is obsolete now and should not be displayed to the end users. Since the number of articles is large, it is difficult to update the content quickly. Let&#8217;s say we have all content [&hellip;]<\/p>\n","protected":false},"author":1357,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":40},"categories":[5868],"tags":[5022,4855,2927,6311,4844,4230,2591,4858,4864],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55524"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1357"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=55524"}],"version-history":[{"count":5,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55524\/revisions"}],"predecessor-version":[{"id":55630,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55524\/revisions\/55630"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=55524"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=55524"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=55524"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}