You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mats Norén <ma...@spectral.se> on 2000/09/29 17:51:12 UTC

Xinclude question!

Tricky question coming up (for me at least) !
Is there a way to include dynamic XSP-pages into one file.
This is what I want to do..(maybe this isn't the best solution but hey, give me a better one then..:-)
1. Generate a menu using the esql-taglib. (the same over the entire site)
2. Generate the content of the page using the esql-taglib.
3. Merge the two together using XInclude
4. do transform it with XSLT

Another one:
1. Generate a menu using the esql-taglib. (the same over the entire site)
2. Make a form to edit the menu...
3. Merge the two
4. Transform

menu.xml

Example:
Let's pretend that the output of the esql.xml is:
<menu>
    <item title="a" link="a" />
    <item title="b" link="b" />
    <item title="c" link="c" />
    <item title="d" link="d" />
</menu>

Now, using fp I would like to do something like this:
form.xml
<if-get>
    <form action="form.xml">
        <input name="reference to item no 1/title">reference item no 1/title</input>
        <input name="reference to item no 1/link">reference item no 1/link</input>
        <input name="submit" value="submit......etc
   </form>
<if-get>
<if-post>
    write to db
</if-post>

If I add the output from esql.xml to the form.xml using Xinclude and then transform them using XSLT then the esql-tags are not evaluated.
What I would like to do is to evaluate the esql-page and include it in the form.xml like this.

<menu>
    <item title="a" link="a" />
    <item title="b" link="b" />
    <item title="c" link="c" />
    <item title="d" link="d" />
</menu>
<fp:if-get>
    <form action="form.xml">
        <input name="reference to item no 1/title" label="">reference item no 1/@title</input>
        <input name="reference to item no 1/link" label="">reference item no 1/@link</input>
        <input name="submit" value="submit......etc
   </form>
<fp:if-get>
<fp:if-post>
    write to back the changed menuitem to db
</fp:if-post>

Then I would like to transform the appropriate item-values into the corresponding input tag.

Is there better way to do this ? It seems rather clumsy.
I tried to mix the two taglibs together but it wouldn't compile (See previous posts)

/Mats