473,698 Members | 2,432 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 1169
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
11303
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
2919
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
1987
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
2646
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
8130
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
3485
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
1547
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
1877
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
9030
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8899
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
8871
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
7737
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
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();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4621
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2007
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.