Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Fetching the url from a xsl sheet(xpath)

Reply
Thread Tools

Fetching the url from a xsl sheet(xpath)

 
 
Taare
Guest
Posts: n/a
 
      04-20-2005
I was thinking about a xsl sheet that could change template depending
on the url, sort of like using $_GET with PHP. I'v heard that XSLT 2.0
got the document() function, but I'v also heard that there is a trick
for doing this with XSLT 1.0, anybody know?

 
Reply With Quote
 
 
 
 
David Carlisle
Guest
Posts: n/a
 
      04-20-2005

> I'v heard that XSLT 2.0 got the document() function,


document() is in XSLT 1.0 as well.
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      04-20-2005


Taare wrote:

> I was thinking about a xsl sheet that could change template depending
> on the url, sort of like using $_GET with PHP. I'v heard that XSLT 2.0
> got the document() function, but I'v also heard that there is a trick
> for doing this with XSLT 1.0, anybody know?


XSLT (even 1.0) stylesheets take external parameters so you could pass
the URL as a parameter to the XSLT processor.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
Taare
Guest
Posts: n/a
 
      04-20-2005
I'm trying to figure out this external parameter thing, maybe you could
show me a exsample? Also, I see that the document() function don't
bring up an "unknow function" error, but it doesn't print the url for
the element either, you got any thoughts about that?

 
Reply With Quote
 
Martin Honnen
Guest
Posts: n/a
 
      04-20-2005


Taare wrote:

> I'm trying to figure out this external parameter thing, maybe you could
> show me a exsample?


As far as XSLT goes you simply do
<xsl:stylesheet
xmlnssl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xslaram name="parameterName" />

...
</xsl:styleshet>
to define the global external parameter. Then it depends on the XSLT
processor and the API it has on how to set the parameter to a value
before you run a transformation.



--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
Taare
Guest
Posts: n/a
 
      04-20-2005
Yeah, I figured that out, as I searched through this group. Right now
I'm just testing stuff with the built in mozilla xslt
engine(TransforMiiX), and it seems to not work. Thanks for all the help
guys, and I'll be a good boy next time and search first then ask

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
url fetching from xml depending upon selection shanti bhushan Python 8 05-18-2010 08:26 AM
Fetching an URL from a GUI, repeatedly and asynchronously Alexander Farber Java 6 03-12-2006 09:35 AM
XSL Question tp xsl:for-each and xsl:variable schaf@2wire.ch XML 1 05-27-2005 09:25 PM
Fetching binary file linked in URL David Jacques C++ 5 11-15-2004 06:24 PM
Fetching protected URL in tomcat Per Steffensen Java 0 08-14-2003 02:11 PM



Advertisments