Non-filtering and passing attribute values

Post here questions and problems related to editing and publishing DITA content.
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Non-filtering and passing attribute values

Post by kmank »

Hello,

I have a need to generate an HTML output that does not filter content during the transform and also passes all attribute values through to the resulting WebHelp. The first part is easy enough; just by not applying a profile during transformation. But is there any way to retain (pass through) all attribute values so that they are viewable in the HTML output?

ex. A concept topic with a para that contains a platform value of server should show an output of

Code: Select all

<p platform="server">
Is this possible in oXygen?
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Non-filtering and passing attribute values

Post by radu_pisoi »

Hi,

Did you try to use the @action="passthrought" value in your DITAVAL?

Code: Select all

<prop action="passthrough" att="platform"/>
In this case, the profiled DITA content will be included in output together with the profiling conditions. The profiling conditions can be found in the output in attributes with form data-profilingAttribute like in the following sample:

Code: Select all

<p class="p" data-platform="server">Include the content in output, and preserve the attribute value as part of the ......</p>
I think this feature is implemented in DITA-OT processor staring with version 2.x.

See more about values you can set in prop/@atction attribute in DITA specification https://www.oxygenxml.com/dita/1.3/spec ... -prop.html.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: Non-filtering and passing attribute values

Post by kmank »

Oh... now that rocks! I was totally unaware of that feature. Thanks so much!
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: Non-filtering and passing attribute values

Post by kmank »

Perhaps I am missing something here. A little help please?
I now have the following para in a concept:

Code: Select all

<p id="v11776594" product="nextgen">NextGen Tools is a collection of applications and command line utilities supporting the authoring, testing, assembly, and generation of NextGen Content.</p>
The ditaval contains:

Code: Select all

<val>
<prop action="passthrough" att="product" val="nextgen"/>
</val>
The output P is:

Code: Select all

<p class="p" id="AboutNextGenTools__v11776594">NextGen Tools is a collection of applications and command line utilities supporting the authoring, testing, assembly, and generation of NextGen Content.</p>
And yes, the ditaval is being selected as the scenario filter. The nextgen value is not being passed through.

Any thoughts?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Non-filtering and passing attribute values

Post by Radu »

Hi,

DITA OT 2.x should have support for pass-through. If you generate output using our WebHelp transformation types, the corresponding profiling attributes should be passed to the HTML content.
If you publish using the "xhtml" transtype, it seems that the DITA OT developers took a decision not to pass to the HTML any "data-" attributes because they wanted the XHTML output to be valid XHTML transitional output which does not support "data-" attributes.
But if you publish using the DITA OT "html5" transtype, the profiling attribute should be passed as data- attributes to the HTML document.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: Non-filtering and passing attribute values

Post by kmank »

so how do I get started? How can I specify the html5 transtype?
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Non-filtering and passing attribute values

Post by Radu »

Hi,

First in the Oxygen Preferences->DITA page you need to make sure DITA OT 2.x is used.
Then open the DITA Map in the DITA Maps Manager, use the Configure Transformation Scenarios toolbar button, create a new scenario of type DITA OT and you will be able to choose among a number of transformation types and you can select HTML5.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: Non-filtering and passing attribute values

Post by kmank »

thanks for getting me this far.
I think I'll need a little more guidance through this. Here is what I have:

Here is the testing ditamap:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<title>Profiling Test</title>
<topicref href="Profile1.xml" product="product1"/>
<topicref href="Profile2.xml" product="product2"/>
</map>
Here is the ditaval:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<val>
<prop action="passthrough" att="product" val="product1"/>
<prop action="passthrough" att="product" val="product2"/>
</val>
I created a new DITA-OT Transformation and selected HTML5 as the type.

The dita.dir parameter is set to:

Code: Select all

${configured.ditaot.dir}
. And Preferences > DITA > DITA Open Toolkit is set to Built-in DITA-OT 2.x.

Here is the resulting HTML:

Code: Select all

<!DOCTYPE html SYSTEM "about:legacy-compat">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<meta name="copyright" content="(C) Copyright 2017">
<meta name="DC.rights.owner" content="(C) Copyright 2017">
<meta name="DC.Type" content="map">
<meta name="DC.Format" content="XHTML">
<link rel="stylesheet" type="text/css" href="commonltr.css">
<title>Profiling Test</title>
</head>
<body>
<h1 class="title topictitle1">Profiling Test</h1>
<nav>
<ul class="map">
<li class="topicref">
<a href="Profile1.html">Product 1</a>
</li>
<li class="topicref">
<a href="Profile2.html">Product 2</a>
</li>
</ul>
</nav>
</body>
</html>
So I am obviously missing something as I would expect to find some class or attribute with "product1" and "product2".

Please advise
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Non-filtering and passing attribute values

Post by Radu »

Hi,

Originally I tested propagating the profiling attribute value at sub-topic level (set the @product on a <p> element and publish, look in the generated HTML topic).
Indeed, now I tested with setting the profiling attribute on the topicref and it does not work, it is not preserved in the generated index.html.
We do not develop the HTML 5 plugin so I added a DITA OT issue for this:

https://github.com/dita-ot/dita-ot/issues/2598

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
kmank
Posts: 118
Joined: Mon Apr 19, 2010 5:33 pm

Re: Non-filtering and passing attribute values

Post by kmank »

Thank you, Radu.
I'll devise a more granular plan.
rjcbop
Posts: 56
Joined: Wed Aug 08, 2018 10:23 pm

Re: Non-filtering and passing attribute values

Post by rjcbop »

It seems as if the issue with passthrough attributes on topicrefs was mostly fixed but it appears that it's not fixed in the case that the topicref is a child and the @chunk attribute of the parent is set to to-content. In that case, the attribute is not propagated through to the html.
Radu
Posts: 9048
Joined: Fri Jul 09, 2004 5:18 pm

Re: Non-filtering and passing attribute values

Post by Radu »

Hi,

Maybe you can put together a small sample DITA project and add an issue for this on the DITA OT issues list:
https://github.com/dita-ot/dita-ot/issues
An alternative might be to maybe avoid chunking and create a DITA topic which has conrefs to all the other topics.

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