Re: including content

Christian Stocker <[email protected]>
Newsgroups gmane.comp.cms.bitflux.general
Organization Bitflux GmbH
Message-ID <[email protected]>

On 14.12.2005 22:57 Uhr, Adrian Nussbaum wrote:
>>> if i choose the first possiblity: can i put this "anywhere" in my
>>> master.xsl-file? right?
>>
>>
>> xinclude doesn't work in xslts, just in static xhtml pages produced  with
>> the xhtml plugin.
> 
> ok. so i have to use <xsl:copy-of ?
> 
>> xinclude is relative to the including document, so you have either go
>> from their (../../../ or from the systems root
>> /var/www/xpure/fluxcms/lala.xml). There's no variable for your   docroot
>> at this stage. One could think of some possibilities, but nothing  really
>> shiny comes to my mind right now, since all need preparsing the  document
>>  with php and libxml and adding the docroot. Not really nice
>> performance-wise. But inc/bx/plugins/xhtml.php would be the place,  right
>> where the xinclude() is done :)
> 
> if i include an xml into the master.xsl it doesn't make sense to set  a
> relative url, does it?

yes it does perfectly make sense if you look from xsltprocessor point of
view, which is outside of the php context and only knows about the
actual filesystem


> i have created a "teaser.de.xhtml" in the admin-interface (doc  root).
> ...and i don't get the clou how i have to set the path now...
> is it really that complicated? (i know its late at this moment - but 
> that's not my problem, really...)

your document() instruction has to look something like this:

document("../../data/teaser.de.xhtml")

then it should include that teaser.de.xhtml

one could do it differently with more magic behind like with
php-stream-wrappers, but I don't think you won't go that way. except you
really have some special needs (or as explained before with the
portlet:// stream wrapper). But if you just want to include one file,
the above should be enough.

You could also call a php function from within the xslt, which returns
an domdocument, but again, if you just want to include one static file,
that's just overhead.

chregu


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71
http://www.bitflux.ch | [email protected] |  GPG 0x5CE1DECB
-- 
bitflux-cms mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bitflux-cms
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.