Hi,
In our print FOSI, we want that if width of the content inside <term> element is more than certain value, then the definition should start in a new line. But we have not found any way in the FOSI to find the width of the content inside any particular element.
Please let us know if there is any way to find the width of the content inside FOSI. It cannot be related with number of characters as width of different characters are different (as it is not AS-IS character).
Best Regards,
Girish Kumar
Girish,
Unfortunately, there is not a way to measure content within an element using FOSI. You can test for attribute values and format accordingly, but that's not going to get you what you want.
The only way I know of (in my limited experience with FOSI, ACL and SGML) is to use an ACL function to measure the content of the tag you want to look at. That measurement can be computed by using some sort of "average" width and multiplying it by the number of characters found in the tag. The result can then be manipluated as needed and fed into the <algroup> indents to give you variable columns that would be based onthe width computed by the ACL function.
There's a lot to consider whentrying to make something "all-emcompassing" for output. Most of the time, FOSI can handle it. However, when the content of a tag is used to somehow determine the output, ACL is almost always required to get the results you want.
Hope this Helps,
Bob
In Reply to Ed Benton:
Assuming that <term> is a child of <deflist>, one of the better ways to do this would be to use "algroup" or side-by-side formatting for the <term> and <def> e-i-c's. You can define the widths in whatever units of measure you want to use, which, for best practices, should be the same used for the other measurements in your FOSI.
Hi,
Thanks to all for the response. It looks to me like the questions itself was not so clear due to which I received mixed responses and I don't feel that any response solves my problem.
So, I am reframing the question/problem:
We have def-list in which <term> and <def> appears side-by-side. We have reserved fixed amount of space for <term> and rest of the space for <def> in the same line in FOSI. Now, look at the below example:
Term A Defintion of term A...
Term B up to 15Defintion of term B...Term C exceeding fifteen characters
Defintion of term C...Term DDefintion of term D...
As can be seen above that for Term C, we want the definition to appear in a new line with same left indentation. So, in general, we want that if text inside <term> exceeds the space reserved for <term>, then <def> should start ina new line.
Now, the question is how we can find out if text inside <term> exceeds the given space.
Best Regards,
Girish Kumar
Hi Girish,
As Gareth said, you can't really determine the exact formatted width that the term element's contents will have. But if a rule based on the number of characters is acceptable then you can accomplish what you need. To have different behaviour in the FOSI based on the amount of characters in the term element, you can set up an <att> rule in the e-i-c for term that calls an ACL function to determine the contents of the element in question. You would set up an att rule to handle each case like this:
<att> <specval attname="MoreThan15Chars" attloc="system-func" attval="1"> ... </att>
and
<att> <specval attname="MoreThan15Chars" attloc="system-func" attval="0"> ... </att>
and then you just need to create a MoreThan15Chars function. The oid of the element whose "e-i-c" contains the specvals will be passed to this function automatically, so you write the function like this:
function MoreThan15Chars(window, oid) {
return length(oid_content($oid)) > 15;
}
# This function will return 1 (true) if the content of the e-i-c is more than 15 characters, 0 (false) if it is equal to or less than 15 characters.
This assumes that you will create the <att> rules in the e-i-c for the term element; if you want to put them in the e-i-c for <def> instead then you would change it to something like:
return length(oid_content(oid_prev($oid))) > 15;
Hope this helps,
Dugald