New Template
It's a good idea aCCuReRaS. I might do a version with individual templates later.
An even better aproach for the Internet though would be to move the xslt-transformations (javascript) to the server side. That way you would would'nt need hundreds of xml files and the page would still only load as much data as it displays. And also you could make it work on Netscape and other browsers by just modifying the stylesheets. It would not be so much work because most of the code can be reused (at least on IIS).
Anyways I will not make any updates for at least 2 weeks.
/w
An even better aproach for the Internet though would be to move the xslt-transformations (javascript) to the server side. That way you would would'nt need hundreds of xml files and the page would still only load as much data as it displays. And also you could make it work on Netscape and other browsers by just modifying the stylesheets. It would not be so much work because most of the code can be reused (at least on IIS).
Anyways I will not make any updates for at least 2 weeks.
/w
first of all I love this template! modified it a bit to my personal taste and it looks fabulous! The only thing really wanted to change was the inablity of using linebreaks in description.
Sometimes I have added a boxset to my catalog as being 1 item and I would like to be able to make a list what is on what CD. Somewhat like this:
I'm no XML wizard but looking at transform.xml got me a bit further. I added a similar template as commas_to_br and it looks like this:
Sometimes I have added a boxset to my catalog as being 1 item and I would like to be able to make a list what is on what CD. Somewhat like this:
Description:
All Season episodes of Blackadder
Season 1 (3 CD's)
The Foretelling, Born to be King
The archbishop
The queen of Spain's beard
The Witchsmeller Pursuivant
The Black Seal
I'm no XML wizard but looking at transform.xml got me a bit further. I added a similar template as commas_to_br and it looks like this:
It's displayed by using this:<xsl:template name="puntcommas_to_br">
<xsl:param name="src" />
<xsl:if test="contains($src, ';')">
<xsl:value-of select="substring-before($src, ';')" />
<br />
<xsl:call-template name="puntcommas_to_br">
<xsl:with-param name="src" select="substring-after($src, ';')" />
</xsl:call-template>
</xsl:if>
</xsl:template>
Very similar to the commas_to_br template. And better yet, it works. My only problem is that though this works just fine. Descriptions for all other movies are not displayed at all! Anyone have any idea why?[/quote]<p class="infoView">
<b>Description:</b><br />
<xsl:call-template name="puntcommas_to_br">
<xsl:with-param name="src" select="description" />
</xsl:call-template>
</p>
and how should I do this?An even better aproach for the Internet though would be to move the xslt-transformations (javascript) to the server side. That way you would would'nt need hundreds of xml files and the page would still only load as much data as it displays. And also you could make it work on Netscape and other browsers by just modifying the stylesheets. It would not be so much work because most of the code can be reused (at least on IIS).
as ANT exports linebreaks as <b> would it be possible to make it like this:
[quote]<xsl:template name="<br>_to_br">
<xsl:param name="src" />
<xsl:if test="contains($src, '<br>')">
<xsl:value-of select="substring-before($src, '<br>')" />
<br />
<xsl:call-template name="<br>_to_br">
<xsl:with-param name="src" select="substring-after($src, '<br>')" />
</xsl:call-template>
</xsl:if>
</xsl:template>[/quote]
Since I know nothinbg about xml and xsl does $src need to be 1 character?
[quote]<xsl:template name="<br>_to_br">
<xsl:param name="src" />
<xsl:if test="contains($src, '<br>')">
<xsl:value-of select="substring-before($src, '<br>')" />
<br />
<xsl:call-template name="<br>_to_br">
<xsl:with-param name="src" select="substring-after($src, '<br>')" />
</xsl:call-template>
</xsl:if>
</xsl:template>[/quote]
Since I know nothinbg about xml and xsl does $src need to be 1 character?
You want to change <br> to <br /> right?
It looks ok but i don't think that you can have <> symbols int the template name.
$src is just a variable that i made up and it can contain as many characters as you want. When you call the template you write:
That is go to the template with the parameter src as select="substring-after($src, '<br>')" = a substring of src after the first <br>.
Since you have an if statement in the beginning (checkin if src contains <br>) you probably want an else statement also so that descriptions that don't contains <br> will be displayed as well. To do this in xsl you have to change it to:
/w
It looks ok but i don't think that you can have <> symbols int the template name.
$src is just a variable that i made up and it can contain as many characters as you want. When you call the template you write:
Code: Select all
<xsl:call-template name="<br>_to_br">
<xsl:with-param name="src" select="substring-after($src, '<br>')" />
</xsl:call-template>
Since you have an if statement in the beginning (checkin if src contains <br>) you probably want an else statement also so that descriptions that don't contains <br> will be displayed as well. To do this in xsl you have to change it to:
Code: Select all
<xsl:choose>
<xsl:when test="contains($src, '<br>')">
your code
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$src" />
</xsl:otherwise>
</xsl:choose>
Last edited by Willspo on 2003-01-01 18:21:44, edited 1 time in total.
-
- Posts: 46
- Joined: 2002-12-14 19:24:59
-
- Posts: 46
- Joined: 2002-12-14 19:24:59
Look at http://www.opera.com/whyopera/ why we love Opera. The most important thing is that IE is so fucking slow.
Hmm, time. I've got an idea: I can answer the questions about your template, then you don't have to look in this forum and you have more time for programming. Okay one disadvantage is, that because of my answers, in one month you are the most hated person all over the net. But that is no problem for me How do you feel about this nice idea?
Hmm, time. I've got an idea: I can answer the questions about your template, then you don't have to look in this forum and you have more time for programming. Okay one disadvantage is, that because of my answers, in one month you are the most hated person all over the net. But that is no problem for me How do you feel about this nice idea?
Same story -- quite a few movies in Russian.
that should take care of it. You don't have to change anything else.
An easy work-around. Open your XML template that you use to export the DB to movies.xml -- at the top change the encoding to thisVery nice template
I tried it works great but I have couple of movies in Russian
for some reason your template does not support Russian at all.
Do you have any idea what needs to be done to enable this support ?
thank you
Jev
Code: Select all
<?xml version="1.0" encoding="windows-1251" ?>