List Info

Thread: XSLT templates how to?




XSLT templates how to?
user name
2007-03-05 02:17:10
Hi:

Sorry for the question but I would appreciate very much some
help.

Seems like I can't avoid XSLT templates. Cos I need more
information
from the feeds. The problem I am having is that I am not
sure where
should I start in order create venus templates. I have basic
knowledge
of XSLT, but I am having a difficult time to seeing relation
betweeen
things in htmltmpl and xslt for example what would be the
XSLT
alternative to the following.

<title><TMPL_VAR channel_name
ESCAPE="HTML"><TMPL_IF title>:
<TMPL_VAR
title_plain
ESCAPE="HTML"></TMPL_IF></title>

It would be nice if there were two templates one in xslt and
one in
htmltmpl  that produce the same output for learning
purpose..

I would very much appreciate some help.

Regards
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: XSLT templates how to?
country flaguser name
United States
2007-03-05 07:47:18
rubdabadub wrote:
> Hi:
> 
> Sorry for the question but I would appreciate very much
some help.
> 
> Seems like I can't avoid XSLT templates. Cos I need
more information
> from the feeds. The problem I am having is that I am
not sure where
> should I start in order create venus templates. I have
basic knowledge
> of XSLT, but I am having a difficult time to seeing
relation betweeen
> things in htmltmpl and xslt for example what would be
the XSLT
> alternative to the following.
> 
> <title><TMPL_VAR channel_name
ESCAPE="HTML"><TMPL_IF title>:
<TMPL_VAR
> title_plain
ESCAPE="HTML"></TMPL_IF></title>

Since this appears to be a FAQ, I've added such a
customization as a 
comment to atom.xml.xslt:

   <xsl:template
match="atom:entry/atom:title">
     <xsl:text>&#10;    </xsl:text>
     <xsl:copy>
       <xsl:apply-templates select="*"/>
       <xsl:value-of
select="../atom:source/planet:name"/>
       <xsl:text>: </xsl:text>
       <xsl:apply-templates
select="node()"/>
     </xsl:copy>
   </xsl:template>

Here's an explanation

For atom title elements that are immediate children of atom
entry:
   <xsl:template
match="atom:entry/atom:title">

Add some white space (purely for decoration)
     <xsl:text>&#10;    </xsl:text>

Copy the title element itself:
     <xsl:copy>

Apply any attributes:
       <xsl:apply-templates select="*"/>

Add the value of the planet title found within the entry
source element:
       <xsl:value-of
select="../atom:source/planet:name"/>

Add some text:
       <xsl:text>: </xsl:text>

Apply any child nodes of the title:
       <xsl:apply-templates
select="node()"/>

close the title:
     </xsl:copy>

End of template:
   </xsl:template>

> It would be nice if there were two templates one in
xslt and one in
> htmltmpl  that produce the same output for learning
purpose..

Blaze a path!  

What you come up with can be committed for others to learn
from.

> I would very much appreciate some help.

Feel free to ask more questions here.

- Sam Ruby
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: XSLT templates how to?
user name
2007-03-06 11:25:02
Sam:

Thanks for the reply. I started to get a hang of it.
>
> > It would be nice if there were two templates one
in xslt and one in
> > htmltmpl  that produce the same output for
learning purpose..
>
> Blaze a path!  
>
> What you come up with can be committed for others to
learn from.

Yes, This is my first task, I am trying to make an XSLT
version of the
rss2.0 template. I will need help but hopefully I will be
able to submit
something soon for review.

> Feel free to ask more questions here.

I will you can count on it 

Cheers
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: XSLT templates how to?
user name
2007-03-10 16:27:23
Hello:

XSLT is not as bad as i thought. Anyway I could pick up all
feed data
using it. However I having
trouble picking up category term/ with the following code..
I am
probably missing something.

     <xsl:if test="atom:category">
     <xyz>
        <xsl:value-of
select="atom:category/atom:term"/>
     </xyz>
     <xsl:text>&#10;</xsl:text>
     </xsl:if>

I have also tried


     <xsl:if
test="atom:category/atom:term">
     <xyz>
        <xsl:value-of
select="atom:category/atom:term"/>
     </xyz>
     <xsl:text>&#10;</xsl:text>
     </xsl:if>
        <xsl:value-of
select="atom:source/atom:category/atom:label"/>


any help

On 3/6/07, rubdabadub <rubdabadubgmail.com> wrote:
> Sam:
>
> Thanks for the reply. I started to get a hang of it.
> >
> > > It would be nice if there were two templates
one in xslt and one in
> > > htmltmpl  that produce the same output for
learning purpose..
> >
> > Blaze a path!  
> >
> > What you come up with can be committed for others
to learn from.
>
> Yes, This is my first task, I am trying to make an XSLT
version of the
> rss2.0 template. I will need help but hopefully I will
be able to submit
> something soon for review.
>
> > Feel free to ask more questions here.
>
> I will you can count on it 
>
> Cheers
>
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

Re: XSLT templates how to?
country flaguser name
United States
2007-03-10 19:11:33
rubdabadub wrote:
> Hello:
> 
> XSLT is not as bad as i thought. Anyway I could pick up
all feed data
> using it. However I having
> trouble picking up category term/ with the following
code.. I am
> probably missing something.
> 
>     <xsl:if test="atom:category">
>     <xyz>
>        <xsl:value-of
select="atom:category/atom:term"/>

Try atom:category/term

- Sam Ruby
-- 
devel mailing list
devellists.planetplanet.org

http://lists.planetplanet.org/mailman/listinfo/devel

[1-5]

about | contact  Other archives ( Real Estate discussion Medical topics )