Re: [WSG] Includes in XHTML

2004-11-28 Thread Mordechai Peller
Jonathan T. Sage wrote:
#Convert all the 's to ::ABBA:: (a rather unlikly string)
 

As I recall, ABBA the name of a popular band in the 70's 
(http://www.abbasite.com/). Then again, there's also the American Bed 
and Breakfast Association (http://www.abba.com/).  Maybe you should use 
&_br; since that's guaranteed not to come up.

**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
**


Re: [WSG] Includes in XHTML

2004-11-28 Thread Patrick H. Lauke
Jonathan T. Sage wrote:
$plBody = preg_replace("//", "::ABBA::", $plBody);
 #Convert all the 's to ::ABBA:: (a rather unlikly string)
$plBody = preg_replace("/<.+?>/", "", $plBody);
  # Drop all other HTML tags
$plBody = preg_replace("/::ABBA::/", "", $plBody);
  #Convert all the ::ABBA::'s back to 's
At the risk of going a bit off topic, you may wish to look at PHP's 
built-in strip_tags function
http://uk2.php.net/manual/en/function.strip-tags.php

$plBody = strip_tags($plBody, '');
But you'll still need to convert plain  to  after that, but 
you can use the slightly quicker str_replace function then

$plBody = str_replace('','',$plBody);
At least this saves you one step without getting any bad disco memories 
involved...

--
Patrick H. Lauke
_
re·dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com
**
The discussion list for  http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
**


Re: [WSG] Includes in XHTML

2004-11-28 Thread Jonathan T. Sage
hello all - thanks for all great suggestions

in the end, I went with a derivative of James' third idea below, and
did a little php/perl magic:

$plBody is the imported file:

$plBody = preg_replace("//", "::ABBA::", $plBody);
 #Convert all the 's to ::ABBA:: (a rather unlikly string)

$plBody = preg_replace("/<.+?>/", "", $plBody);
  # Drop all other HTML tags

$plBody = preg_replace("/::ABBA::/", "", $plBody);
  #Convert all the ::ABBA::'s back to 's

For this application, the users autorized to post here are really
unlikly to be talking about 1970's popular disco.

Thanks again - and I realize that this is nearing OT-ness, but I
figured my solution might be helpful to others.

~j


On Sun, 28 Nov 2004 22:28:02 +1100, James Ellis <[EMAIL PROTECTED]> wrote:
> 
> I suggest one or more of the following three options:
> 
> 1 running the markup through Tidy - http://au.php.net/tidy
> (You'll have to compile PHP with Tidy - more at link above).
> 2 using an HTML4.0 transitional doctype for the pages that display 3rd
> party markup.
> 3 use strip_tags to remove unwanted markup from the 3rd party stuff -
> http://au.php.net/manual/en/function.strip-tags.php
> 
> 
> > Jonathan T. Sage wrote:
> >
> > >I was wondering if there is an easy way to tell the
> > >browser to render just a section of the page in a HTML4 mode, to avoid
> > >it bombing out.

-- 
Jonathan T. Sage
Theatrical Lighting / Set Designer
Professional Web Design

[HTTP://www.JTSage.com]
[HTTP://design.JTSage.com]
[EMAIL PROTECTED]
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
**



Re: [WSG] Includes in XHTML

2004-11-28 Thread James Ellis
Hi Jonathon

I suggest one or more of the following three options:

1 running the markup through Tidy - http://au.php.net/tidy
(You'll have to compile PHP with Tidy - more at link above).
2 using an HTML4.0 transitional doctype for the pages that display 3rd
party markup.
3 use strip_tags to remove unwanted markup from the 3rd party stuff -
http://au.php.net/manual/en/function.strip-tags.php

HTH
James


On Sun, 28 Nov 2004 08:54:03 +0200, Mordechai Peller <[EMAIL PROTECTED]> wrote:
> Jonathan T. Sage wrote:
> 
> >I was wondering if there is an easy way to tell the
> >browser to render just a section of the page in a HTML4 mode, to avoid
> >it bombing out.
> >
> You could use an object tag, but it would suffer from most of the
> negatives of an iframe.
> 
> If you choose to have PHP parse the HTML, as Rob suggested, I believe
> there are some tools available. You may find something at
> http://pear.php.net or http://sourceforge.net/. I think HTML Tidy is a
> possibility (http://tidy.sourceforge.net/).
> 
> 
> **
> The discussion list for  http://webstandardsgroup.org/
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> **
> 
>
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
**



Re: [WSG] Includes in XHTML

2004-11-27 Thread Mordechai Peller
Jonathan T. Sage wrote:
I was wondering if there is an easy way to tell the
browser to render just a section of the page in a HTML4 mode, to avoid
it bombing out.
You could use an object tag, but it would suffer from most of the 
negatives of an iframe.

If you choose to have PHP parse the HTML, as Rob suggested, I believe 
there are some tools available. You may find something at 
http://pear.php.net or http://sourceforge.net/. I think HTML Tidy is a 
possibility (http://tidy.sourceforge.net/).
**
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
**


Re: [WSG] Includes in XHTML

2004-11-27 Thread Jonathan T. Sage
alright, dumb question anyway.  My original expectation on all these
includes was that the incoming file was plaintext, with only 
replacments on newlines.  A little php magic and I just dumped the
rest of the markup.  Thanks for the time

~j



On Sun, 28 Nov 2004 01:55:14 +0100, Rob Mientjes <[EMAIL PROTECTED]> wrote:
> You can't render a part of a page as HTML, but it is possible to let
> PHP parse all pages with some variable or something like that as HTML
> instead of XHTML.
> 
> 
> 
> 
> On Sat, 27 Nov 2004 19:51:21 -0500, Jonathan T. Sage <[EMAIL PROTECTED]> 
> wrote:
> > good evening -
> >
> >   I've set up my site to serve as XHTML 1.1 - the entire site is
> > actually a single PHP file that parses a bunch of XML.  my problem
> > comes in on a few pages where I am actually serving an e-mail archive,
> > some of which contains some not very well written HTML (hotmail
> > actually).  I was wondering if there is an easy way to tell the
> > browser to render just a section of the page in a HTML4 mode, to avoid
> > it bombing out.  google hasn't turned up much.  For more info on what
> > I'm looking to fix, take a look at the sub pages of :
> >
> > http://theatre.msu.edu/Productions/smcallboard.php
> >
> > thanks ~j
> >
> > --
> > Jonathan T. Sage
> > Theatrical Lighting / Set Designer
> > Professional Web Design
> >
> > [HTTP://www.JTSage.com]
> > [HTTP://design.JTSage.com]
> > [EMAIL PROTECTED]
> > [See Headers for Contact Info]
> > **
> > The discussion list for  http://webstandardsgroup.org/
> >
> >  See http://webstandardsgroup.org/mail/guidelines.cfm
> >  for some hints on posting to the list & getting help
> > **
> >
> >
> 
> 
> --
> Cheers,
> Rob.
> » http://www.zooibaai.nl/b/
> 
> 
> **
> The discussion list for  http://webstandardsgroup.org/
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> **
> 
> 


-- 
Jonathan T. Sage
Theatrical Lighting / Set Designer
Professional Web Design

[HTTP://www.JTSage.com]
[HTTP://design.JTSage.com]
[EMAIL PROTECTED]
[See Headers for Contact Info]
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
**



Re: [WSG] Includes in XHTML

2004-11-27 Thread Rob Mientjes
You can't render a part of a page as HTML, but it is possible to let
PHP parse all pages with some variable or something like that as HTML
instead of XHTML.


On Sat, 27 Nov 2004 19:51:21 -0500, Jonathan T. Sage <[EMAIL PROTECTED]> wrote:
> good evening -
> 
>   I've set up my site to serve as XHTML 1.1 - the entire site is
> actually a single PHP file that parses a bunch of XML.  my problem
> comes in on a few pages where I am actually serving an e-mail archive,
> some of which contains some not very well written HTML (hotmail
> actually).  I was wondering if there is an easy way to tell the
> browser to render just a section of the page in a HTML4 mode, to avoid
> it bombing out.  google hasn't turned up much.  For more info on what
> I'm looking to fix, take a look at the sub pages of :
> 
> http://theatre.msu.edu/Productions/smcallboard.php
> 
> thanks ~j
> 
> --
> Jonathan T. Sage
> Theatrical Lighting / Set Designer
> Professional Web Design
> 
> [HTTP://www.JTSage.com]
> [HTTP://design.JTSage.com]
> [EMAIL PROTECTED]
> [See Headers for Contact Info]
> **
> The discussion list for  http://webstandardsgroup.org/
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> **
> 
> 


-- 
Cheers,
Rob.
» http://www.zooibaai.nl/b/
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
**



[WSG] Includes in XHTML

2004-11-27 Thread Jonathan T. Sage
good evening -

  I've set up my site to serve as XHTML 1.1 - the entire site is
actually a single PHP file that parses a bunch of XML.  my problem
comes in on a few pages where I am actually serving an e-mail archive,
some of which contains some not very well written HTML (hotmail
actually).  I was wondering if there is an easy way to tell the
browser to render just a section of the page in a HTML4 mode, to avoid
it bombing out.  google hasn't turned up much.  For more info on what
I'm looking to fix, take a look at the sub pages of :

http://theatre.msu.edu/Productions/smcallboard.php

thanks ~j

-- 
Jonathan T. Sage
Theatrical Lighting / Set Designer
Professional Web Design

[HTTP://www.JTSage.com]
[HTTP://design.JTSage.com]
[EMAIL PROTECTED]
[See Headers for Contact Info]
**
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
**