You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Thorsten Scherler <th...@juntadeandalucia.es> on 2009/08/28 15:17:57 UTC

[users@httpd] Server Side Includes - include only a certain "xpath"

Hi all,

I have a page that includes various parts via ssi.
e.g. <!--#include virtual="/head.shtml"-->

On our current version we "hack" the included pages to an invalid html
doc. Basically we strip it down to e.g. "<div> ...blah...</div>" However
this leaves documents that are not valid against xhtml dtd.

Is there a way to include a certain part of a page like e.g.
<!--#include virtual="/head.shtml" part="/html/head"-->

TIA for any information and suggestions.

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Server Side Includes - include only a certain "xpath"

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Mon, 2009-08-31 at 11:03 +0200, Thorsten Scherler wrote:
> On Fri, 2009-08-28 at 14:32 +0100, Nick Kew wrote:
> > Thorsten Scherler wrote:
> > > Hi all,
> > > 
> > > I have a page that includes various parts via ssi.
> > > e.g. <!--#include virtual="/head.shtml"-->
> > > 
> > > On our current version we "hack" the included pages to an invalid html
> > > doc. Basically we strip it down to e.g. "<div> ...blah...</div>" However
> > > this leaves documents that are not valid against xhtml dtd.
> > > 
> > > Is there a way to include a certain part of a page like e.g.
> > > <!--#include virtual="/head.shtml" part="/html/head"-->
> > > 
> > > TIA for any information and suggestions.
> > 
> > mod_publisher, as a markup-aware parser, can help with that
> > kind of thing, if you can map your requirements to SAX events.
> > 
> > Alternatively, if everything is XML and you want to use xpath,
> > you might try mod_transform.
> > 
> > In either case, you'll have some work to figure it out.
> 
> 
> Thanks Nick I will look into those mods and report back.

In the end we used the old approach since our production department did
not wanted too install other mods.

Cheers for your feedback again.

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Server Side Includes - include only a certain "xpath"

Posted by Thorsten Scherler <th...@juntadeandalucia.es>.
On Fri, 2009-08-28 at 14:32 +0100, Nick Kew wrote:
> Thorsten Scherler wrote:
> > Hi all,
> > 
> > I have a page that includes various parts via ssi.
> > e.g. <!--#include virtual="/head.shtml"-->
> > 
> > On our current version we "hack" the included pages to an invalid html
> > doc. Basically we strip it down to e.g. "<div> ...blah...</div>" However
> > this leaves documents that are not valid against xhtml dtd.
> > 
> > Is there a way to include a certain part of a page like e.g.
> > <!--#include virtual="/head.shtml" part="/html/head"-->
> > 
> > TIA for any information and suggestions.
> 
> mod_publisher, as a markup-aware parser, can help with that
> kind of thing, if you can map your requirements to SAX events.
> 
> Alternatively, if everything is XML and you want to use xpath,
> you might try mod_transform.
> 
> In either case, you'll have some work to figure it out.


Thanks Nick I will look into those mods and report back.

salu2
-- 
Thorsten Scherler <thorsten.at.apache.org>
Open Source Java <consulting, training and solutions>

Sociedad Andaluza para el Desarrollo de la Sociedad 
de la Información, S.A.U. (SADESI)





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Server Side Includes - include only a certain "xpath"

Posted by Chuck Crisler <ch...@comcast.net>.
My mistake. The file permissions are rwxr-xr-x. I hit a 'w' instead of
an 'x'.

Yes, when it fails I get a selinux message. *I WILL INVESTIGATE THAT!!!*
I am somewhat new to Linux and don't know all of the pieces that well,
especially selinux. Thank you. I didn't realize that it was separate.

Chuck
On Fri, 2009-08-28 at 14:32 +0100, Nick Kew wrote:
> Thorsten Scherler wrote:
> > Hi all,
> > 
> > I have a page that includes various parts via ssi.
> > e.g. <!--#include virtual="/head.shtml"-->
> > 
> > On our current version we "hack" the included pages to an invalid html
> > doc. Basically we strip it down to e.g. "<div> ...blah...</div>" However
> > this leaves documents that are not valid against xhtml dtd.
> > 
> > Is there a way to include a certain part of a page like e.g.
> > <!--#include virtual="/head.shtml" part="/html/head"-->
> > 
> > TIA for any information and suggestions.
> 
> mod_publisher, as a markup-aware parser, can help with that
> kind of thing, if you can map your requirements to SAX events.
> 
> Alternatively, if everything is XML and you want to use xpath,
> you might try mod_transform.
> 
> In either case, you'll have some work to figure it out.
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Server Side Includes - include only a certain "xpath"

Posted by Nick Kew <ni...@webthing.com>.
Thorsten Scherler wrote:
> Hi all,
> 
> I have a page that includes various parts via ssi.
> e.g. <!--#include virtual="/head.shtml"-->
> 
> On our current version we "hack" the included pages to an invalid html
> doc. Basically we strip it down to e.g. "<div> ...blah...</div>" However
> this leaves documents that are not valid against xhtml dtd.
> 
> Is there a way to include a certain part of a page like e.g.
> <!--#include virtual="/head.shtml" part="/html/head"-->
> 
> TIA for any information and suggestions.

mod_publisher, as a markup-aware parser, can help with that
kind of thing, if you can map your requirements to SAX events.

Alternatively, if everything is XML and you want to use xpath,
you might try mod_transform.

In either case, you'll have some work to figure it out.

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org