473,395 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Fetching the url from a xsl sheet(xpath)

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?

Jul 20 '05 #1
5 1147
I'v heard that XSLT 2.0 got the document() function,


document() is in XSLT 1.0 as well.
Jul 20 '05 #2


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/
Jul 20 '05 #3
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?

Jul 20 '05 #4


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
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:param 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/
Jul 20 '05 #5
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 :)

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Rohleder | last post by:
Hi, I'm using a style-sheet where I make use of the XPATH-"following-sibling"-expression. The part which makes problems looks similar to the following code: --------------------------- ...
6
by: Ramon M. Felciano | last post by:
Helo all -- I'm trying to gain a deeper understand for what type of semi-declarative programming can be done through XML and XPath/XSLT. I'm looking at graph processing problems as a testbed for...
1
by: Loudin | last post by:
Hello, I`ve got Problems with Xpath and xsltproc/libxslt. I have got a variable with tags in my Style sheet and later in the same Style sheet i want to work with this tags using a...
3
by: IMS.Rushikesh | last post by:
Hi Friends, I need a XPath query, whcih ll return me subset of data.... check below xml stream <label id="MyExpenseDetails_lbl" xlink:role="terseLabel">Short Expense Details</label> <label...
9
by: JJ | last post by:
Hi All, I noticed that XmlNode and XpathNavigator are quite similiar. XmlNode seems to navigate over an XML Doc and so does XPathNav so when do I use XPathNavigator instead of XmlNode? ...
1
by: darrel | last post by:
I'm still struggling with xpath syntax. I'm creating a menu via XSLT that checks to see if any given node has a descendant somewhere down the chain that is the 'current active page' and, if so,...
2
by: Richard | last post by:
Hi, I am trying to use an XmlDocument object to manipulate the default database instance node of the enterprise template library dataConfiguration section from a custom installer step: <?xml...
3
by: rnurse | last post by:
Hi All, I'm new to XML and I'm working with an XSL style sheet. In this file I've noticed the following XPath reference: <xsl:for-each select="//SomeNodeName"> .. .. ..
3
by: abcd_68 | last post by:
Hi there, I'm using, for the first time, the JDK1.5 Xpath API. I need to find elements in a Hibernate-generated .hbm.xml file. These files come with a <!DOCTYPE header mentioning a remote URL....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.