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

Special characters and white space in gentext?

Moonstone

Special characters and white space in gentext?

O Mighty FOSI
Gurus--


I think I'm in need
of some divine intervention. I am trying to display some code sample text as
gentext in my screen FOSI. I have this working for simple examples, and it
correctly preserves white space in the gentext sometimes. So, for example, I can
have something like this:


while (foo != bar)
{

print "so far
so good...";


foo++;

}


And it works right,
preserving the newlines and the indenting.
class=870335720-15022006>The problem comes when the code
contains any markup-ish characters, such as "<", ">", or "&". In that
case, the FOSI seems to want to interpret the text as markup--meaning it
collapses the white space--no matter how I try to convince it not to. For
example, if I have


for (foo=0; foo <
bar; foo++) {

print "so far
so good...";

}


it will show up on
the screen as:



for (foo=0;
foo< bar; foo++) {
face=Arial size=2> print "so far so good..."; class=870335720-15022006>}



Something about
having the "<" in the text makes Epic replace the newlines with spaces. Well,
naturally, the solution is to use entities instead of the offending characters,
right? So I should change it to this:



for (foo=0;
foo< bar; foo++) {

print "so far
so good...";

}


Unfortunately, that
doesn't help, I still lose my newlines. Even with the modified code, it still
shows up on the screen as:

class=870335720-15022006>
for (foo=0;
foo< bar; foo++) {
face=Arial size=2> print "so far so good..."; class=870335720-15022006>}


I've tried a few variations of escaping the
special characters so that the entire thing prints with white space preserved,
but I haven't been able to find the magic combination that works.


Can anyone point out the right way to
include those special characters in generated text without causing it to
collapse the whitespace?


class=870335720-15022006>
--Clay
Tags (2)
5 REPLIES 5
Highlighted

RE: Special characters and white space in gentext?



When I need linebreaks in my gentext
output, I can usually accomplish what I need with "&#RE;" or "
"
embedded in my conrules.








Of course, most of my gentext output that
requires a linebreak is written to an external file with a userule='1',
so gentext in the output stream may treat it differently, but it's worth
a try...








-Jason







<span<br/>style='font-size:10.0pt;font-family:Tahoma'
Highlighted

RE: Special characters and white space in gentext?

Hi Jason--


Ah, if only it were that simple. The newlines (
)
are definitely there in the strings already. As long as neither "<" or
"&" appears in the text of the string, the newlines are rendered correctly.
But if the text contains either "<" or "&" anywhere in the string, then
none of the newlines are displayed (or rather they are displayed as
spaces). So I need to know how to create gentext that has BOTH newlines
AND special characters and have it rendered correctly, preserving the white
space in the string and displaying the special characters.


class=697184321-15022006>
--Clay





From: Buss, Jason A

Sent: Wednesday, February 15, 2006
3:41 PM
To: 'adepters@arbortext.com'
Subject: RE: Special
characters and white space in gentext?




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">When I need linebreaks
in my gentext output, I can usually accomplish what I need with "&#RE;" or
"
" embedded in my conrules.



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Of course, most of my
gentext output that requires a linebreak is written to an external file with a
userule='1', so gentext in the output stream may treat it differently, but it's
worth a try...



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">-Jason


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----
Wednesday, February 15, 2006 3:17
PM
Subject:
Special characters and white space in gentext?



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">O Mighty FOSI
Gurus--




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I think I'm in need of some divine
intervention. I am trying to display some code sample text as gentext in my
screen FOSI. I have this working for simple examples, and it correctly preserves
white space in the gentext sometimes. So, for example, I can have something like
this:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">while (foo != bar)
{




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
foo++;




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And it works right, preserving the
newlines and the indenting. The problem comes when the code contains any
markup-ish characters, such as "<", ">", or "&". In that case, the
FOSI seems to want to interpret the text as markup--meaning it collapses the
white space--no matter how I try to convince it not to. For example, if I
have




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo < bar; foo++)
{




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">it will show up on the screen
as:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) { print "so far so good..."; }





style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Something about having the "<" in
the text makes Epic replace the newlines with spaces. Well, naturally, the
solution is to use entities instead of the offending characters, right? So I
should change it to this:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) {




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Unfortunately, that doesn't help, I
still lose my newlines. Even with the modified code, it still shows up on the
screen as:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) { print "so far so good..."; }




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I've tried a few variations of
escaping the special characters so that the entire thing prints with white space
preserved, but I haven't been able to find the magic combination that
works.




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Can anyone point out the right way
to include those special characters in generated text without causing it to
collapse the whitespace?




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
--Clay



Highlighted

RE: Special characters and white space in gentext?



I've used the distributed "book"
doctype to do preformatted code with special chars. You could check that
(or DocBook) FOSI styles for doing preformatted text, and then possibly steal (excuse
me, I mean "reuse") the styles, and apply them to a pseudo element
that you can wrap around your gentext...








I'm in training, and not in front of
my materials, so I'm kinda shooting in the dark here...








-Jason







<span<br/>style='font-size:10.0pt;font-family:Tahoma'
Highlighted

RE: Special characters and white space in gentext?

Hi Jason--


Thanks, man, you gave me the crucial clue! Initially I was
just dumping the text into a usetext, that's where I was getting the problem.
But I took your suggestion and wrapped it in a pseudo-element, et
voila--everything works fine now.


Pretty good for a shot in the dark....
🙂


class=408590122-15022006>
--Clay





From: Buss, Jason A

Sent: Wednesday, February 15, 2006
3:56 PM
To: 'adepters@arbortext.com'
Subject: RE: Special
characters and white space in gentext?




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I've used the
distributed "book" doctype to do preformatted code with special chars. You
could check that (or DocBook) FOSI styles for doing preformatted text, and then
possibly steal (excuse me, I mean "reuse") the styles, and apply them to a
pseudo element that you can wrap around your gentext...



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">I'm in training, and
not in front of my materials, so I'm kinda shooting in the dark
here...



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">-Jason



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">


style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----
Wednesday, February 15, 2006 3:50
PM
Subject:
RE: Special characters and white space in gentext?



Hi
Jason--



Ah, if
only it were that simple. The newlines (
) are definitely there in the
strings already. As long as neither "<" or "&" appears in the text of the
string, the newlines are rendered correctly. But if the text contains either
"<" or "&" anywhere in the string, then none of the newlines are
displayed (or rather they are displayed as spaces). So I need to know how
to create gentext that has BOTH newlines AND special characters and have it
rendered correctly, preserving the white space in the string and displaying the
special characters.




style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">--Clay




face=Tahoma size=2>style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:face=Tahoma size=2> Wednesday, February 15, 2006 3:41
PM
RE: Special characters and white
space in gentext?



" embedded in my conrules.


Of course,
most of my gentext output that requires a linebreak is written to an external
file with a userule='1', so gentext in the output stream may treat it
differently, but it's worth a try...






style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">-----Original
Message-----
Wednesday, February 15, 2006 3:17
PM
Subject:
Special characters and white space in gentext?



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">O Mighty FOSI
Gurus--




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I think I'm in need of some divine
intervention. I am trying to display some code sample text as gentext in my
screen FOSI. I have this working for simple examples, and it correctly preserves
white space in the gentext sometimes. So, for example, I can have something like
this:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">while (foo != bar)
{




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
foo++;




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And it works right, preserving the
newlines and the indenting. The problem comes when the code contains any
markup-ish characters, such as "<", ">", or "&". In that case, the
FOSI seems to want to interpret the text as markup--meaning it collapses the
white space--no matter how I try to convince it not to. For example, if I
have




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo < bar; foo++)
{




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">it will show up on the screen
as:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) { print "so far so good..."; }





style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Something about having the "<" in
the text makes Epic replace the newlines with spaces. Well, naturally, the
solution is to use entities instead of the offending characters, right? So I
should change it to this:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) {




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> print "so far so
good...";




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">}



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Unfortunately, that doesn't help, I
still lose my newlines. Even with the modified code, it still shows up on the
screen as:




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">



style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">for (foo=0; foo< bar;
foo++) { print "so far so good..."; }




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I've tried a few variations of
escaping the special characters so that the entire thing prints with white space
preserved, but I haven't been able to find the magic combination that
works.




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Can anyone point out the right way
to include those special characters in generated text without causing it to
collapse the whitespace?




style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
--Clay



>> To unsubscribe from the list, send
an email to listmanager@maillist.arbortext.com with the following in the body:
unsubscribe adepters - For additional information on the adepters list (how to
subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>> >> To unsubscribe from
the list, send an email to listmanager@maillist.arbortext.com with the following
in the body: unsubscribe adepters - For additional information on the adepters
list (how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>>


>> To unsubscribe from the list, send an email to
listmanager@maillist.arbortext.com with the following in the body: unsubscribe
adepters - For additional information on the adepters list (how to subscribe or
unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the
following in the body: info Adepters - You may also go to forums.arbortext.com,
enter the Adepters folder and change your subscription options and
preferences.>>
Highlighted

XML to XML

Hi All,

Is there anyway I can do an XML to XML conversion
using XSLT in Arbortext (epic editor, e3, etc.)?

Thanks in advance!

S.E.

Announcements