if you are a human please do not click here
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Username :
Password :
Home
Help
Calendar
Register
Login
XMetaL Community Forums
»
General
»
DITA and XMetaL Discussion
»
Creating a conditional inside a conref
Pages:
1
« previous
next »
Print
Author
Topic: Creating a conditional inside a conref (Read 568 times)
sgrayson
Member
Posts: 11
Creating a conditional inside a conref
«
on:
May 06, 2011, 10:41:19 AM »
I've searched through the DITA documentation but can't find the answer. I'm using XMetal Author Enterprise 6.0.
I would like to be able to use a conref for a phrase but be able to insert content into that phrase. For example, I would like to conref this sentence and have the datatype name be a variable I can insert into the conref:
See the [datatype name] datatype for more information.
Creating the conref for the sentence is easy; I just don't know how to add one of the many datatype names each time I use the sentence without creating two conrefs, one on each side of the datatype name. Any ideas?
Thanks,
Steve
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1546
Re: Creating a conditional inside a conref
«
Reply #1 on:
May 06, 2011, 02:30:56 PM »
Most likely what you are looking for is what our documentation refers to as "conditional text". Can you have a look at that and see if it sounds like what you want?
Logged
sgrayson
Member
Posts: 11
Re: Creating a conditional inside a conref
«
Reply #2 on:
May 06, 2011, 06:00:34 PM »
No, that's not quite it I believe. What I would like is more of something like this:
The conref:
<ph id=response_sentence" class="- topic/ph">The [parameter] API section provides
the necessary response.</ph>
Usage
<ph conref="MWS_conrefs.dita#response_sentence" parameter=Product/>
The Product API section provides the necessary response.
OR
<ph conref="MWS_conrefs.dita#response_sentence" parameter=Order/>
The Order API section provides the necessary response.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1546
Re: Creating a conditional inside a conref
«
Reply #3 on:
May 09, 2011, 02:49:47 PM »
Conditional text will do this for you. You just need to decide which conditional text attribute makes the most sense for your usage. My first instinct would be to use @product, but that is really intended to produce different outputs for similar but different products.
In your case you could use any of the standard ones, including @otherprops. See the DITA Language Reference topic
Here's your DITA rewritten to use the otherprops conditional text attribute:
<ph id="response_sentence" class="- topic/ph">The <ph otherprops="product">Product</ph> <ph otherprops="order">Order</ph> API section provides the necessary response.</ph>
Then when you produce your output you would create a ditaval file that says "include" @otherprops="product" and "exclude @otherprops="order" (or the opposite, or both, or neither). XMetaL can be configured so that it will display a dialog for you to pick from and will then automatically generate the ditaval file for you based on your choices.
If you configure XMetaL's conditional text feature you can then set conditional text values and generate output based on them by selecting radio buttons in dialogs:
1) You can use the first two items on the Reuse menu to:
a) Set conditional text value(s) for the current element.
b) Style contional text so that the background of different elements with different conditional text values appear with colours of your choosing.
2) When you generate output you can select the button labelled Show/Hide Conditional Text to change your output based on these values and have XMetaL automatically generate the right ditaval file settings for you.
See these help topics:
Conditional text
Creating and modifying conditions
Apply a condition
Show conditional text in previews and output
Style conditional text
Logged
sgrayson
Member
Posts: 11
Re: Creating a conditional inside a conref
«
Reply #4 on:
May 09, 2011, 04:06:59 PM »
Sorry, Derek, I don't seem to be explaining myself. I want to use the conref multiple times in a document, and have a parameter I provide in each use inserted as the variable in the conref. We have to use lots of conrefs where the only change is one word, and I was looking for a solution where I didn't have to create a conref on each side of a word. I was looking to make the word the variable inside a single conref.
Thanks,
Steve
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1546
Re: Creating a conditional inside a conref
«
Reply #5 on:
May 09, 2011, 05:12:57 PM »
Sounds to me like what you want just doesn't exist in DITA 1.1. I think the closest you can get is to use conditional text as I have described here.
Perhaps what you really wish to have might be solved using DITA 1.2 and its keyref, keydef, keyword elements and the notion of "key spaces".
Logged
Pages:
1
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Forum Information
=> General XMetaL Discussion
=> DITA and XMetaL Discussion
=> XMetaL Tips and Tricks
=> XMetaL Announcements and Events
Loading...
email us