Re: including content

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

On 13.12.2005 11:23 Uhr, Adrian Nussbaum wrote:
> hi
> 
> i come back to the xinclude-question.
> i tried some things... but it didn't work that well...
> 
> on my post a looong time ago you answered:
> 
>> Yep. And then you have different possibilities to include this.   One way
>> is to use xinclude, which works like a php include:
>>
>>     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
>> href="../teaser.xml#xmlns(xhtml=http://www.w3.org/1999/xhtml)
>> xpointer(/xhtml:html/xhtml:body/xhtml:div)"
>> parse="xml"/>
>>
>> or document() in the xslt
>>
>> <xsl:copy-of
>> select="document('../teaser.xml')/xhtml:html/xhtml:body/xhtml:div"/>
>>
>> Or, if you need something more dynamic, with portlets, from the 
>> blog.xsl:
>>
>>    <xsl:for-each
>> select="document('portlet://blog/rss.xml')/bx/plugin/xhtml:html/
>> xhtml:body/xhtml:div[@class='entry'
>> and position() &lt; 6]">
>>
>> chregu
> 
> 
> 
> 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.

> your "teaser.xml"-example: is this a "normal" xhtml-ressource,  created
> in the admin-interface?

It's any xml file, can be an xhtml-resource or an uploaded xml file in
the files folder.

> how do i have to set the href-URL, if my doc (xhtml) is in the root?

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 :)

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.