Transformation with profiling (conditions within a single to

Here should go questions about transforming XML with XSLT and FOP.
BarbaraLGreen
Posts: 5
Joined: Wed Jan 26, 2011 12:06 am

Transformation with profiling (conditions within a single to

Post by BarbaraLGreen »

Is there a way to apply a separate transformation profile to some topics within the same bookmap?

In other words, I want Product1.dita to include the product="product1" info, and Product2.dita to include the product="product2" info. The product info is set off with ph elements.

Background:

I discuss several products within a single book. The book describes the image files used with each product, and since the information is mostly the same for all products, with slight differences, I tried the following approach:

1. I created a reusable text topic as the base content. This topic uses the ph tag with the product attribute for those phrases that are different or that apply to only one or two products.

2. I then created a reference topic for each product with the product attribute set to a single product (e.g., Product1.dita has product="product1", Product2.dita has product="product2" etc.). Each of these topics has a conref to the reusable text, and any additional, product-specific info.

However, editing the profile attributes for transformation seems to apply to all topics in the book. I get a transformation error that some topics have no content because of the product attribute that is set for that topic.

I've looked for more info, but did not find a clear answer. Any expert advice welcome.


Thanks,
Barbara
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation with profiling (conditions within a single to

Post by Radu »

Hi Barbara,

Usually you should set profiling conditions directly on the topic references from the DITA Map.
For example:

Code: Select all

<topicref href="Product1.dita" product="product1"/>
But setting them on the topic root element should also work despite on the DITA Open Toolkit warning.

From what I understand you should simply remove the product conditions completely from the topic references (or topic files) if you want both topics to appear in the generated output.
You should only add profiling conditions in places where you want to filter content.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BarbaraLGreen
Posts: 5
Joined: Wed Jan 26, 2011 12:06 am

Re: Transformation with profiling (conditions within a single to

Post by BarbaraLGreen »

Thanks for the tip about applying filters in the Ditamap. I will use that. But I wonder if that will solve the issue at run time? Say I have the following in my ditamap:

<appendix href="topics/product-option-reference.dita">
<topicref href="reference/product1.dita" product="product1"/>
<topicref href="reference/product2.dita" product="product2"/>
</appendix>

product1.dita and product2.dita are reference topics with a title and a conref to a section in reuse.dita. In reuse.dita, I have some paragraphs that look like:

<p>The icon image will be used to promote the application in the <ph product="product1" id="p1im">Product1 store</ph><ph product="product2" id="p2im">Product2 Marketplace</ph>.</p>

In a single transformation (not separate books) I need product1.dita to show:

The icon image will be used to promote the application in the Product1 store.

And product2.dita to show:

The icon image will be used to promote the application in the Product2 Marketplace.

At transformation, I need both products to be visible. I'm not doing a separate transformation for each product. I just need the conditional text to show up in the right topic. Right now, I either get all the conditional text showing, or I get one product to show, and the other topic errors out because no text in the topic matches the value in ditaval. Does that make sense?

Thanks for taking the time to help. I've been looking at this for awhile now, and it's really got me stumped.

Barbara
Radu
Posts: 9439
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation with profiling (conditions within a single to

Post by Radu »

Hi Barbara,

Alright, so your common content has profiling conditions and you would like to show it in two places (where it is conreffed), in one place with one profiling condition and in the other with another profiling condition applied.

The DITA conditional processing filters are applied globally on the DITA Map and you cannot exclude from a topic different parts depending on different places from where it is conreffed.

Maybe you can write about this issue on the DITA Users List:
http://tech.groups.yahoo.com/group/dita-users/
But I think you are gonna have to duplicate some content.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
BarbaraLGreen
Posts: 5
Joined: Wed Jan 26, 2011 12:06 am

Re: Transformation with profiling (conditions within a single to

Post by BarbaraLGreen »

Radu,

Thanks so much. That was what I suspected, but I thought I might be missing some technique.

I will head over to Ditausers and see if anyone has a different approach for this.

Thanks,
Barbara
Post Reply