>> Linczak, Jonathan W. wrote: >> >> OK, >> >> This is probably a really simple question, but I didn't find any quick >> answers, so I really hope you can help. >> >> Say I have a very simple XML file (simple.xml) with the following contents: >> >> <roottag> >> <option>Some value</option> >> </roottag> >> >> I would like to create a pipeline that reads the XML file above, and >> then use it in the pipeline, perhaps like this: >> >> <map:pipeline> >> <map:match pattern="something"> >> <map:read src="simple.xml"/> >> <map:redirect-to url="http://www.someplace.com/test.php?id={value >> inside <option> tag}"/> >> </map:match> >> </map:pipeline> >> >> Any way to grab the contents of the file read and use it in the pipeline?
> If your roottag xml is static (some config file), you can define
> a customized XMLInputModule.
>
> Other question is, what is the result of test.php, not (XML)
> content you want to process?
Well, the file is static, no doubt, but it would be reading from multiple
files, pulling out that one value, and using it in the pipeline. The above was
an example, but not what I was aiming for. This ties into Lenya, but this
example should still be easy to follow:
I create a "doctype" labeled "redirector" in Lenya. I can create a pipeline to
match for all "redirector" doctypes as so:
<map:pipeline>
<map:match pattern="lenyabody-*/*/*/redirector/**">
<map:read
src="cocoon:/lenya-document-{1}/{3}/redirector/{page-envelope:document-path}"/>
<map:redirect-to url="{value inside <url> tags}"/>
</map:match>
</map:pipeline>
where the read part (if indeed a <map:read/> is needed - I'm only guessing)
would come back with the contents of the file, which would look like this:
<redirector>
<url>http://www.someplace.com/</url>
</redirector>
See where I am trying to head with this one? Basically, if I find that the
document requested is of doctype "redirector", I read the file's contents, and
use the value to redirect the user to the appropriate place. I know that you
can technically just generate the file, and use a transformer to create an HTML
page where inside the <head> tags you can add a meta-refresh, but there's a
slight pause there, even if set at 0 for the time. I've been adding pipelines
to each page that needs to do this, but I'm looking for a more general solution.
Someone had given me their solution, but I'm a bit lost with it, so by going
this route, I hope to learn enough to understand their solution as well.
Jon
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
