RE: [xsl] xsl filters pipeline again...

Subject: RE: [xsl] xsl filters pipeline again...
From: "Ross Ken" <Ken.Ross@xxxxxxxxxxxxxx>
Date: Wed, 22 Jan 2003 07:35:10 +1000
Is there some reason you don't have top level xsl:param for language, information level, and display mode and then restrict the apply-templates based on them both in the one pass?

eg
<xsl:param name="language">1</xsl:param> <!-- I always like a default -->
<xsl:param name="section">3</xsl:param> <!-- I still like a default -->
<xsl:param name="displaymode">3</xsl:param> <!-- yet more defaults -->

<xsl:template match="/">
	<xsl:apply-templates select="//CONTENT[LAN={$language} and LEVEL={$section} and DISPLAY={$displaymode}]" />
</xsl:template>

<xsl:template match="CONTENT">
	<!-- XML to HTML stuff -->
</xsl:template>

That way you only need the XML to HTML XSLT and can pass it the three parameters

Ken Ross
Ph: +61 7 32359370
Mob: +61 (0)419 772299
Email: Ken.Ross@xxxxxxxxxxxxxx


-----Original Message-----
From: Errea Alexandra [mailto:aleph675@xxxxxx]
Sent: Wednesday, 22 January 2003 6:11 AM
To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] xsl filters pipeline again...


Hello again!!! Thank u for answering  me so quickly!What i want to do with
these filters is:
1)the first filter should choose between the language(1 or 2) assuming that
this parameter is taken from a database after a query concerning what the
user wants. (never mind this for now...)So it should give me an xml output
which should look like this,assuming that the user speaks english:

<?xml version="1.0" encoding="ISO-8859-7"?>
<?xml-stylesheet type="text/xsl" href="023.xsl"?>
<SITES>
<CONTENT><!--English -->
<LAN>1</LAN>       <!-- 1.EN -->
<LEVEL>1</LEVEL>
<DISPLAY>1</DISPLAY> <!-- 1.SMS  2.WAP 3.WEB -->
<TITLE>Mars Hill</TITLE>
<TEXT>yess</TEXT>
<IMAGE></IMAGE>
</CONTENT>
<CONTENT>
<LAN>1</LAN>       <!-- 1.EN -->
<LEVEL>2</LEVEL>
<DISPLAY>1</DISPLAY> <!-- 1.SMS  2.WAP 3.WEB -->
<TITLE>Mars Hill</TITLE>
<TEXT>hello</TEXT>
<IMAGE></IMAGE>
</CONTENT>
<CONTENT>
<LAN>1</LAN>       <!-- 1.EN -->
<LEVEL>3</LEVEL>
<DISPLAY>1</DISPLAY> <!-- 1.SMS  2.WAP 3.WEB -->
<TITLE>Mars Hill</TITLE>
<TEXT>hola</TEXT>
<IMAGE></IMAGE>
</CONTENT>
</SITES>

2)the second one should do the same thing on this xml file and not the
original one but it should exclude two out of the three levels,e.g. level 1
and level 2, assuming that the user wants only level 3 info,so it should
give me an xml output like this:

<?xml version="1.0" encoding="ISO-8859-7"?>
<?xml-stylesheet type="text/xsl" href="023.xsl"?>
<SITES>
<CONTENT>
<LAN>1</LAN>       <!-- 1.EN -->
<LEVEL>3</LEVEL>
<DISPLAY>1</DISPLAY> <!-- 1.SMS  2.WAP 3.WEB -->
<TITLE>Mars Hill</TITLE>
<TEXT>hola</TEXT>
<IMAGE></IMAGE>
</CONTENT>
</SITES>

3)now the last filter should  choose between displays and it should give me
an html output showing an image if i have display=2 or a simple html text if
i have display=1. I havemanaged to show an image with an xsl stylesheet with
an html output. So the problem is how to combine these things.Should i have
only one xsl,using xsl:import for example...or should i have three different
xsl's???And where should i declare these?
I've tried this only for the first filter with ur help but it doesn't give
me anything :(((

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" version="4.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates/>
<xsl:for-each select="SITES/CONTENT">
<xsl:if match=".[LAN='1']">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>

Thank you in advance and sorry for the huge question....I'm reaally stuck:(





 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

IMPORTANT: This email (including any attachments) may contain confidential,
private or legally privileged information and may be protected by copyright. You may
only use it if you are the person(s) it was intended to be sent to and if you use it in an
authorised way. No one is allowed to use, review, alter, transmit, disclose, distribute,
print or copy this e-mail without appropriate authority.
 
If this e-mail was not intended for you and was sent to you by mistake, please
telephone or e-mail me immediately, destroy any hard copies of this e-mail and delete
it and any copies of it from your computer system. Any legal privilege and 
confidentiality attached to this e-mail is not waived or destroyed by that mistake.
 
It is your responsibility to ensure that this e-mail does not contain and is not affected
by computer viruses, defects or interference by third parties or replication problems
(including incompatibility with your computer system).




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread