| Date: | Mon, 18 Nov 2002 00:26:04 -0800 |
| Reply-To: | John Kirkpatrick <johnk_uk@HOTMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | John Kirkpatrick <johnk_uk@HOTMAIL.COM> |
| Organization: | http://groups.google.com/ |
| Subject: | Re: ODS and resolving html tags |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Pete,
I'm not sure why your first solution with protectspecialchars didn't
work: it should have! (And does on my machine.) I suspect the
problem lies in your redefinition of the default style, but can't be
sure as you didn't supply the code.
Here's my version of your example, which does deal with the tags in
your put and title statements (on W2k, V8.2).
title1 h=12pt f='Arial' 'Test of Resolving Tags and ODS';
title3 h=10pt f='Arial' 'Just the<br>br tag';
title5 h=10pt f='Arial' '<a>The br tag wrapped<br>in a null anchor</a>
';
title7 h=10pt f='Arial' '<a> </a>The br tag with a<br>leading null
anchor';
proc template;
define style myHTML/store=work.templates;
parent=styles.default;
style batch from batch/
protectspecialchars=off;
style systemtitle from systemtitle/
protectspecialchars=off;
end;
run;
ods path (prepend) work.templates;
ods results;
ods listing close;
ods html body="c:\tag test.html" style=myHTML;
data _null_;
file print;
put / 'Same items in PUT statements:' /;
put 'Just the<br>br tag' /;
put'<a>The br tag wrapped<br>in a null anchor</a> ' /;
put '<a> </a>The br tag with a<br>leading null anchor' /;
put '<?>The br tag wrapped a<br>in a bogus tag</?>';
run;
ods html close;
ods listing;
In my experience, the reason the "same" HTML/RTF/etc code works in one
situation and not in another relates to the different wrappers that
SAS puts around the text that you actually write. This can change the
context into which your output is written, sometimes with unexpected
results.
Sorry to be vague about why your workaround sometimes works and
sometimes doesn't but the real world is beckoning, and you should now
have the proper solution anyway!
HTH
John
pete.lund@NWCSR.COM (Pete Lund) wrote in message news:<DDEPIAEIKIPBIOPAAKFKOEHBCAAA.pete.lund@nwcsr.com>...
> Hello all-
> The little test program below demonstrates a phenomenon I don't quite
> understand. In a real program I'm programmatically generating footnotes for
> use with ODS HTML. I wanted to force multiple lines (in a single footnote)
> and so inserted a <br> tag in the footnote text. Lo and behold the "<br>"
> showed up in the resultant html and upon viewing the source saw that the
> tags had been converted to < and >.
> I played around with things a bit and got it to work if I start and end
> the footnote text with a tag/close tag, like <a>...</a>. Take a look at the
> output from the following program and explain to me what ODS is doing and if
> there's a change that could be made to the style template to prevent it. I
> have tried changing the ProtectSpecialCharacters parameter from AUTO to NO
> in the style template and it didn't help.
> Thanks for any assistance. This isn't critical since I have a fairly
> simple work around - just wondering why ODS is rendering the tag values
> differently in different situations.
>
> title1 h=12pt f='Arial' 'Test of Resolving Tags and ODS';
> title3 h=10pt f='Arial' 'Just the<br>br tag';
> title5 h=10pt f='Arial' '<a>The br tag wrapped<br>in a null anchor</a> ';
> title7 h=10pt f='Arial' '<a> </a>The br tag with a<br>leading null anchor';
>
> ods listing close;
> ods noresults;
> ods html body="c:\temp\ods tag test.html" style=default;
>
> data _null_;
> file print;
> put / 'Same items in PUT statements:' /;
> put 'Just the<br>br tag' /;
> put'<a>The br tag wrapped<br>in a null anchor</a> ' /;
> put '<a> </a>The br tag with a<br>leading null anchor' /;
> put '<?>The br tag wrapped a<br>in a bogus tag</?>';
> run;
>
> ods html close;
> ods listing;
> ods results;
>
>
> ---------------------------------------------------------------------
> Pete Lund
> Northwest Crime and Social Research, Inc.
> A SAS Alliance Partner
> 215 Legion Way SW
> Olympia, WA 98502
> pete.lund@nwcsr.com
> (360) 528-8970 - voice
> (360) 280-4892 - cell
> (360) 570-7531 - fax
> www.nwcsr.com
> ---------------------------------------------------------------------
|