473,734 Members | 2,824 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

<xsl:param name="parameter Name" />

...
</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(Transfor MiiX), 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
11309
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: --------------------------- <xsl:for-each select="headdata/extension/person">
6
2926
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 this, and came across a problem that I haven't been able to solve elegantly. The problem is to find "linker" vertexes that a pair of verteces from a pre-defined set. For example, if the graph verteces represent cities and edges represent flights...
1
1992
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 <xsl:for-each>. Here is a example:
3
2650
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 id="MyExpenseDetails_lbl" xlink:role="displayLabel">Expense Details</label> <label id="InternalExpense_lbl" xlink:role="displayLabel">Internal
9
8132
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? Thanks, JJ
1
3486
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, then it should display itself. I've been using this for my syntax: <xsl:if test="page/linkID | page/page/linkID | page/page/page/linkID | page/page/page/page/linkID = $activeLink">
2
1550
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 version="1.0" encoding="utf-8"?> <dataConfiguration> <xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
3
355
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
1880
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. The Xpath parser fetches the URL from the hibernate.sourceforge site. So far so good. However, if I unplug the network, I get (after a *long* timeout) a java.net.SocketException. I looked around and I found out that I have to define a class...
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8777
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9452
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9237
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9184
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6033
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3262
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2729
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.