![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Possible to have XSL test URL? [Thread Next] Re: Possible to have XSL test URL?To: NULL Date: 12/10/2006 9:27:00 PM
> I know I know, you will say "write an XSL for each page" but that isn't
> possible here, because I'm working in a CMS and I don't want to write
> the same template over and over again for each piece of content.
> So, can the XSL just look at the address of the page, and then do
> something? What is the code I would have to use to tell it to look at
> that?
So, you are probably going to discover the
xsl:param
instruction.
This is a very common way in any programming language to avoid repeating
(almost) the same code -- have program units (templates in XSLT) that accept
as parameters the varying parts of the code.
Cheers,
Dimitre Novatchev
<general.havok@g...> wrote in message
news:1165606313.853395.100450@f......
Thanks for the responses.
Yes I know about XSL:choose, and I could use that if I wished, but
that's not the main thrust of my question. What I want is for it to
test the URL of the page it is on (what shows up in the address bar).
So, if it is on a certain page, I want it to do this. If it is on
another page, I want it to do that. See?
I know I know, you will say "write an XSL for each page" but that isn't
possible here, because I'm working in a CMS and I don't want to write
the same template over and over again for each piece of content.
So, can the XSL just look at the address of the page, and then do
something? What is the code I would have to use to tell it to look at
that?
Erwan Amoureux wrote:
> Excuse me but your question is not very clear...
> What URL would you test ?
> A URL writted in the XSLT ? In a parameter ? The URL's XSLT ?
> --
> My english is (very) rusted ,please , don''''t hesitate to correct me
> Thanks
>
> rédacteur/modérateur xml sur developpez.com
>
>
> "Dimitre Novatchev" wrote:
>
> > If you know about xsl:if, then the next step is to learn about
> > xsl:choose
> >
> >
> > Cheers,
> > Dimitre Novatchev
> >
> >
> > <general.havok@g...> wrote in message
> > news:1165526268.911012.45060@f......
> > > Want to know if this is possible.
> > > I want to create an XSL file that will work with multiple webpages.
> > > I'd like to have a situation where the XSL would test the url and do a
> > > certain action depending on what page it is.
> > > For example, look at this made up code ( I don't know how to actually
> > > program what I want to do, if it's even possible, thats why I ask.)
> > > <xsl:if (url=page1)
> > > action
> > > </xsl:if>
> > > <xsl:if (url=page2)
> > > different action
> > > </xsl:if>
> > >
> > > The way my website is, a CMS, it's very inefficient for me to create a
> > > million templates and XSL files when I should be able to do it all
> > > with
> > > one XSL file that just has if statements to take care of all the
> > > differences.
> > >
> > > Thanks.
> > >
> >
> >
> >
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
