|
Subject: Re: [xsl] StreamBurner to preview Atom and RSS From: "Schimon Jehudah sch@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sat, 7 Mar 2026 19:37:49 -0000 |
Liam.
You tought me fundamental techniques of XSLT which significantly
improved my work.
I think that, this solution could not work; yet, I might be wrong.
On Sat, 7 Mar 2026 00:10:48 -0000
"Liam R. E. Quin liam@xxxxxxxxxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Fri, 6 Mar 2026 12:15:08 -0000
> "Schimon Jehudah sch@xxxxxxxxxxxx"
> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> > Is it valid or possible to allocate XPath directives as variables
> > and apply the variables as XPath directives, similarly to "eval"?
> >
> > <xsl:variable name="feed-subtitle"
> > select="'atom:subtitle'"/>
> >
> > <xsl:variable name="entry-iterate"
> > select="'atom:entry'">
>
> No, but you can have,
>
> <xsl:template match="atom:subtitle">
> <xsl:value-of select="." />
> </xsl:template>
>
> and call it by name or implicitly with apply-templates.
>
How so?
The process which I realize, is to query for required data (textual
content or nodes); and then to pass them to create a document.
That process is conducted to several documents (Atom, FOAF, and RSS).
I sent to you two documents.
* streamburner.xslt - the current working stylesheet with code
repetitions.
* streamburner-test.xslt - the stylesheet which should reduce
repetition of code.
Herein a short example of the structure of streamburner-test.xslt
<!-- XMPP PubSub Atomsub 1.0 version. -->
<xsl:template match="/pubsub:pubsub">
<xsl:variable name="description"
select="'//pubsub:items/@node'"/>
<xsl:variable name="generator"
select="'StreamBurner XSLT Edition'"/>
<xsl:variable name="mimetype"
select="'application/pubsub+xml'"/>
<xsl:variable name="feed-title"
select="'//pubsub:items/@title'"/>
</xsl:template>
<!-- The Atom Syndication Format 1.0 version. -->
<xsl:template match="/atom:feed">
<xsl:variable name="description"
select="'atom:subtitle/text()'"/>
<xsl:variable name="generator"
select="'StreamBurner XSLT Edition'"/>
<xsl:variable name="mimetype"
select="'application/atom+xml'"/>
<xsl:variable name="feed-title"
select="'atom:title/text()'"/>
</xsl:template>
<!-- Template to compile and XHTML document. -->
<xsl:template name="compile-xhtml">
<xsl:param name="description"/>
<xsl:param name="generator"/>
<xsl:param name="mimetype"/>
<xsl:param name="feed-title"/>
<html>
<!-- Code to compile an XHTML document -->
</html>
</xsl:template>
Please. Do correct me if I am wrong.
> In xslt 3 and 4 you can be more clever.
>
After I realize a solution with XSLT 1.0, I will explore to realize the
same with XSLT 3 and 4.
Thank you,
Schimon
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] StreamBurner to preview A, Liam R. E. Quin liam | Thread | [xsl] Help to prevent copying of pr, Schimon Jehudah sch@ |
| Re: [xsl] StreamBurner to preview A, Schimon Jehudah sch@ | Date | [xsl] Help to prevent copying of pr, Schimon Jehudah sch@ |
| Month |