cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with tag not breaking accross line

sylvain.castong2
1-Newbie

Problem with tag not breaking accross line

Hi all

I thought this was going to be an easy one. I use Epic 4.4k.

Here's what I want to do:

Both tag <metric> and <imperial> shouldand do not break across line. This is ok.The content of <metric> could beon1 line and thecontent of <imperial> on the next line.

But I want thetag <spec> tobreak cross line but it does not. Both <metric> and <imperial> are always together and sometimes crosses the the right margin.

Here's an example howit is presented inxml:

<para>bla bla bla <spec><metric>999 999 999</metric><imperial>888,888,888</imperial></spec></para>

Here's the FOSI portion for both <metric> and <imperial>:

<charlist>

<wordsp inherit="0" minimum=".3em" nominal=".3em" maximum=".3em">
<highlt inherit="1">
<keeps scope="line" keep="7"></charlist>

Now here's the FOSI for <spec>

<e-i-c gi="spec"> <charlist> <highlt<br/>inherit="1"> <keeps scope="line" keep="0"></charlist> </e-i-c>

Is there something I do not understand

Thanks in advance for your help.

Sylvain

12 REPLIES 12

A hard keep (7) will never break. If there is room to start the element
on one line, it may continue past the margin in order to remain on the
same line. If you want different behavior for <metric> and <imperial>
when they are within a <spec> tag, make a separate e-i-c for each of
those, with a context="spec".


Hi,

Ok, that is what I have done. The keep for tag <spec> is 0 and the keep for the tag <metric> and <imperial> is 7.

The <metric> tag goes to the next line even if there is enough space on the current line. It seems that the keep rule for the tag <spec> is not applied. Tags <spec>, <metric> and <imperial> have hidden attributes ,but this should have nothing to do with the keep rules.

If it can help, I have attached a jpg to visualise the problem andhere's the FOSI portion of those tags:

<e-i-c gi="imperial" context="spec">

<charlist inherit="1">

<wordsp inherit="0" minimum=".3em" nominal=".3em" maximum=".3em">

<highlt inherit="1">

<keeps scope="line" keep="7"><charlist>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="both">

<charsubset>

<usetext source="\(\" placemnt="before"><usetext>

<usetext source="imperial.txt,\)\" placemnt="after"><usetext>

<charsubset>

<att>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="imperial">

<charsubset>

<usetext source="imperial.txt" placemnt="after"><usetext>

<charsubset>

<att>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="metric">

<charsubset>

<suppress sup="1">

<reset resetlist="imperial.txt">

<reset resetlist="imperial_abbr.txt"><charsubset>

<att>&brp_uom_attribdecl_imperial;

&brp_uom_range_operator_imperial_print;

<e-i-c>

<e-i-c gi="metric" context="spec">

<charlist>

<wordsp inherit="0" minimum=".3em" nominal=".3em" maximum=".3em">

<highlt inherit="1">

<keeps scope="line" keep="7"><charlist>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="both">

<charsubset>

<usetext source="metric.txt,\ \" placemnt="after"><usetext>

<charsubset>

<att>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="metric">

<charsubset>

<usetext source="metric.txt" placemnt="after"><usetext>

<charsubset>

<att>

<att>

<specval attname="units_of_measure" attloc="bulletin" attval="imperial">

<charsubset>

<suppress sup="1">

<reset resetlist="metric.txt">

<reset resetlist="metric_abbr.txt"><charsubset>

<att>&brp_uom_attribdecl_metric;

&brp_uom_range_operator_metric_print;

<e-i-c>

<e-i-c gi="spec">

<charlist>

<highlt inherit="1">

<keeps scope="line" keep="0"><charlist>

<e-i-c>

Thanks again

I see from your screenshot that you are generating a space at the end of
the <metric> element, which would be necessary in order for Epic to have
a place to put the line break. However, because the generated text is
inside the element and thus subject to the keep, this space is probably
not considered as a line break opportunity.

You'd need to either add a space between the <metric> and <imperial>
elements, if that's an option, or somehow generate a space between them.
Since FOSI doesn't provide a way to arbitrarily place generated text at
locations other than the beginning or end of an element, the only other
option I can see would be to use pseudo elements and suppression to
apply the keep to just the content of the <metric> element and possibly
some of the generated text, but not the space. This would complicate
the authoring environment unless you have separate screen and print
FOSIs.

In short, I'm afraid there is no simple answer to this, at least without
knowing more about your application.

Brandon Ibach
Lockheed Martin Space Systems
Cape Canaveral, FL
321-476-7051

Sylvain,
The obligatory disclaimer: you're at a version that's much earlier, so what I tell you may or may not work the same. Nevertheless...

First, there are attributes on the FOSI's <rsrcdesc> element that must be set. According to 'help 318' you must have the dfltlayoutconfig set to 'rigid'. There is indication that setting softkeepspage to '1' implies that softkeepsline is also '1', but I do not know that for certain. In any case, at the minimum for your situation, softkeepsline must be set to '1'. These settings are what makes the number in the keep attribute relative. You may have already done this.

Second, you have set a keep on the SPEC element. Yes, you set it low (actually, you set it outside its allowed range of 1 to 7), but you actually shouldn't have it set at all. You do not want it to keep that element together, so delete the <keeps> from that e-i-c. This eliminates any possibility of a conflict between keeping the SPEC together, and keeping one or both of its children together.

The above has not been specifically tested with a copy of your structure, but follows our FOSI coding experience/practice. If following this advise does not fix your problem, we will be very interested to hear the result, and whatever it is that does eventually do so.

Interested Regards,
Steve Thompson
TAD Technical
Boeing-IDS Technical Publications
(316)977-0515
MC K83-08
The truth is the truth even if nobody believes it, and a lie is a lie even if everyone believes it.

NOTICE: This communication may contain proprietary or other confidential information. If you are not the intended recipient, or believe that you have received this communication in error, please do not print, copy, retransmit, disseminate, or otherwise use the information. Also, please indicate to the sender that you have received this e-mail in error, and delete the copy you received. Any and all views expressed are the current understanding of the sender and should not be interpreted as an expression of official Boeing Company policy or position.

Les renseignements contenus dans ce message peuvent être confidentiels. Si vous n'êtes pas le destinataire visé ou une personne autorisée à lui remettre ce courriel, vous êtes par la présente avisé qu'il est strictement interdit d'utiliser, de copier ou de distribuer ce courriel, de dévoiler la teneur de ce message ou de prendre quelque mesure fondée sur l'information contenue. Vous êtes donc prié d'aviser immédiatement l'expéditeur de cette erreur et de détruire ce message sans garder de copie.


Thanks Brandon and Steve for your input.Getting close but I have new findings to share with you all.

I have 2 separate FOSIs, 1 for screen and 1 for print.

I have made the following changes: <rsrcdesc softkeepspage="1"> and <rsrcdesc dfltlayoutconfig="rigid"> and that did not correct the problem.

The <spec> in the DTD is constructed like this:

To enable a space between<metric> and <imperial> for testing purposes,I modified the DTD like this:

and that did the job. The <metric> stayed on the current line. So to better understand, I set the keep rule to 7 for the <spec> tag. By doing this I was assuming that whatever is in<spec> will not break to the next line, but IT DID. Now I am very confused.

and that did the job. The <metric> stayed on the current line. So to better understand, I set the keep rule to 7 for the <spec> tag. By doing this I was assuming that whatever is in<spec> will not break to the next line, but . Now I am very confused.

I have 2 questions:

Is there a way to add a space between <metric> and <imperial> without changing the DTD.

Why the <spec> tag does not apply the keep = 7 rule? Here's the FOSI portion:

<e-i-c gi="spec"><charlist inherit="1"><keeps scope="line" keep="7"></charlist></e-i-c>

Thanks again

Hello Sylvain,

It's been awhile since I worked in FOSI's but I'll try to answer your
questions.

1. You can add a space between <metric> and <imperial> by creating a
pseudo element which has the link break information (or even prespacing
could do the trick) enclosed on it or you could change the elements to
be inline elements rather then blocks. Change the page layout to column
for that particular area and then use a keep of 6/7 and pre-space to
line them all up. This stops text overlapping and can create the space
you need with the start line attributes.

2. Keeps are conditional so may be overwritten depending on the
priorities and condtions of all elements on a page (you may have too
many keeps across blocks so it is only meeting those with the highest
priorities. A keep with a value of 7 is higher (more important) than one
with a keep of 1.

I've had a similar problem which I was able to fix by making a section
of a page into two columns with the two elements inline with keeps of 6
rather then blocks and single page layout and then using the start line
feature on the inline elements.

Hope that is of some help.

Cheers,
Juliette

The fact that you have separate screen and print FOSIs should actually
make this much easier, as you can freely use techniques in the print
FOSI that would have undesirable effects in the editor.

In the print FOSI, remove the keep from the main <charlist> of the
<metric> e-i-c. Setup the <att> that handles the case where both
elements' contents are displayed so that the <metric> contents are
suppressed, just as you do now in the case where it isn't displayed.
Add a <usetext> that produces the generated text you currently have, as
well as the contents (#CONTENT), but without the trailing en-space. Set
the keep to 7 for the usetext. Finally, in a separate usetext with no
keep, generate the en-space to separate the contents of the two
elements.

Disclaimer: This is straight from my head and has not been tested. If
this doesn't work as I've described it, you might try using a
pseudo-element in the first usetext and apply the keep in the e-i-c for
the pseudo-element.

Brandon Ibach
Lockheed Martin Space Systems
Cape Canaveral, FL
321-476-7051



It seems to me that what you want to do should work, so I tried it, with no success.
I encourage you to report the problem to PTC/Arbortext and let us know
the outcome, please 🙂

I tried the same workaround Brandon came up with. Code is below. Note the sizewhatever.fmt formatting pseudo-element which makes the word space between metric and imperial as narrow or wide as you need. Be sure to use a word space and not a fixed amount such as 4pt because a fixed space does not break as a word space does.

Good luck!
Suzanne Napoleon
www.FOSIexpert.com

<para>Xxxxx xx xxx xxx xx xxxxx xxxxxxx. Xxx xxxxx xxxx xxx xxxx.
Xxxxx xx xxxxx. For these parts torque to <spec><metric>111 111 255</metric>
<imperial>1,884</imperial></spec>.</para><para>Xxxxx xx xxx xxx xx
xxxxx xxxxxxx. Xxx xxxxx xxxx xxx xxxx. Xxxxx xx xxxx xxxx xxx xxxx.
For these parts torque to <spec><metric>111 111 255</metric><imperial>1,884
</imperial></spec>.</para>

FOSI
<rsrcdesc softkeepsline="1" dfltlayoutconfig="rigid">

<e-i-c gi="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset>
<usetext<br/>source="<keep-together-line.fmt>,metric.txt,</keep-together-line.fmt>,<size-whatever.fmt>,\ \,</size-whatever.fmt>,<keep-together-line.fmt>,\(\,imperial.txt,\)\,</keep-together-line.fmt>"
placemnt="after"></usetext>
</charsubset>
</att>
</e-i-c>

<e-i-c gi="metric" context="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset charsubsetref="SUPPRESS">
<savetext textid="metric.txt" conrule="#CONTENT,\m\"></charsubset>
</att>
</e-i-c>

<e-i-c gi="imperial" context="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset charsubsetref="SUPPRESS">
<savetext textid="imperial.txt" conrule="#CONTENT,\ft\"></charsubset>
</att>
</e-i-c>

<e-i-c gi="size-whatever.fmt">
<charlist inherit="1" charsubsetref="inline">
</charlist>
</e-i-c>

<e-i-c gi="keep-together-line.fmt">
<charlist inherit="1" charsubsetref="inline">
<keeps scope="line" keep="7"></charlist>
</e-i-c>


Hi

The flexibility of usingpseudo-elements... Ialready use pseudo-elements with other tags in my FOSI. Butfor what I wanted to do with the tag <spec>, I was blindly convinced without a doubt that I could use the DTD tags toavoid using pseudo-elements. This is a lesson for me!

I have adjusted the FOSI code below for my needs: there is an attributeat the root tag to displayonly metric or only imperial or both in the document, and everything works well: only the content of the tag <imperial> in a pseudo-element breaks to the next line.

Thank you all for your help for this one, really appreciated.


In Reply to Suzanne Napoleon:

It seems to me that what you want to do should work, so I tried it, with no success.
I encourage you to report the problem to PTC/Arbortext and let us know
the outcome, please 🙂

I tried the same workaround Brandon came up with. Code is below. Note the sizewhatever.fmt formatting pseudo-element which makes the word space between metric and imperial as narrow or wide as you need. Be sure to use a word space and not a fixed amount such as 4pt because a fixed space does not break as a word space does.

Good luck!
Suzanne Napoleon
www.FOSIexpert.com

<para>Xxxxx xx xxx xxx xx xxxxx xxxxxxx. Xxx xxxxx xxxx xxx xxxx.
Xxxxx xx xxxxx. For these parts torque to <spec><metric>111 111 255</metric>
<imperial>1,884</imperial></spec>.</para><para>Xxxxx xx xxx xxx xx
xxxxx xxxxxxx. Xxx xxxxx xxxx xxx xxxx. Xxxxx xx xxxx xxxx xxx xxxx.
For these parts torque to <spec><metric>111 111 255</metric><imperial>1,884
</imperial></spec>.</para>

FOSI
<rsrcdesc softkeepsline="1" dfltlayoutconfig="rigid">

<e-i-c gi="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset>
<usetext<br/>source="<keep-together-line.fmt>,metric.txt,</keep-together-line.fmt>,<size-whatever.fmt>,\ \,</size-whatever.fmt>,<keep-together-line.fmt>,\(\,imperial.txt,\)\,</keep-together-line.fmt>"
placemnt="after"></usetext>
</charsubset>
</att>
</e-i-c>

<e-i-c gi="metric" context="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset charsubsetref="SUPPRESS">
<savetext textid="metric.txt" conrule="#CONTENT,\m\"></charsubset>
</att>
</e-i-c>

<e-i-c gi="imperial" context="spec">
<charlist inherit="1" charsubsetref="inline"></charlist>
<att>
<specval attname="print-only" attloc="system-var" attval="yes">
<charsubset charsubsetref="SUPPRESS">
<savetext textid="imperial.txt" conrule="#CONTENT,\ft\"></charsubset>
</att>
</e-i-c>

<e-i-c gi="size-whatever.fmt">
<charlist inherit="1" charsubsetref="inline">
</charlist>
</e-i-c>

<e-i-c gi="keep-together-line.fmt">
<charlist inherit="1" charsubsetref="inline">
<keeps scope="line" keep="7"></charlist>
</e-i-c>


Sylvain,

I'm glad to hear this is working for you. 🙂

I'll add a tip and a plug 😉

<tip>To support formatting requirements that cannot be accomplished with the current DTD, you can make a separate "publishing DTD" that includes the elements and/or attributes you need -- just make them optional. The publishing DTD is used just for producing formatted output. Authoring and other processes continue to use the "authoring DTD," which keeps everyone happy.</tip>

<plug>Pseudo-elements can be extremely powerful in a FOSI. Formatting pseudo-elements are covered in Tutorial 1-10 in Part 1 of my FOSI tutorials, and programming pseudo-elements are covered in Tutorial 2-17 in Part 2. More info about the tutorials, including TOCs and excerpts, is at


I agree whole-heartedly with Suzanne's tip.

We have been using separate publishing and authoring DTD's for years
now. Our print-publishing SGML DTD is practically almost a giant "or"
group. We transform from our authoring XML DTD to our print-publishing
SGML DTD and one of our IETM SGML DTD's using DSSSL. We use XSLT for
some of our non-print publishing XML outputs. Our authoring XML DTD has
a rich enough tag set that we seldom need to add new tags or structures
to it, and when we have a new or changed output, we just change or add
new transfomation scripts to accommodate. This keeps our authors' work
environment stable and keeps them happy, for the most part.


And for the Styler people wondering if they are missing something, the
equivalent of a FOSI psuedo-element is a Styler User Formatting Element,
a.k.a. UFE. Or as I keep telling people, "UFEs are your friend".

John Dreystadt
Software Development Director
Arbortext - PTC
734-352-2835
-


Announcements