473,695 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When is XSLT not appropriate?

ted
Was wondering if XSLT alone is appropriate for the following situation.

From XML, I'm creating a small website (around 50 pages) with pages that
link to each other through a nav menu and a "crumb-trail" of links. I'm
transforming the XML with XSLT through Saxon.

The nav menu and "crumb-trail" show the user where they are within the site
and is made by reflecting the XML tree structure.

My problem now is that when I want to generate a page that references
information that lies in another context in the XML (referenced with an
IDREF), I go into that other context to get it. But this makes my nav menu
and "crumb trail" reflect that other context - not the one the user is
currently in (the one where the IDREF is). I can't figure out how to get
around this.

Would using Java and XSLT be more appropriate for jobs like this?

TIA,
Ted


Jul 20 '05 #1
2 3902
On Wed, 27 Aug 2003 10:09:13 GMT, "ted" <te************ @yahoo.com>
wrote:
Was wondering if XSLT alone is appropriate for the following situation.
Yes.
From XML, I'm creating a small website (around 50 pages) with pages that
link to each other through a nav menu and a "crumb-trail" of links.


I did this a few years back. As I don't reckon much to XML's IDREF for
representing graph structures, I used RDF instead.

To handle the "context switching", I used a good many variables, most
of which were passed as parameters to named templates.

For the breadcrumb trail itself, I just used an axis of
ancestor-or-self::

<!-- Breadcrumb trails -->

<xslt:templat e name="breadcrum bs" >
<xslt:param name="Applicati on" select="/.." />
<!-- Display a "breadcrumb " trail (as described by Nielsen) to show
where the Application is in the overall hierarchy -->

<div id="divBreadcru mbs" >
<xslt:for-each
select="$Applic ation/ancestor-or-self::*[substring-after(@rdf:type ,
'#')='Applicati on']" >
<xslt:if test="position( )!=1" > -&gt; </xslt:if>
<span class="applicat ion" ><xslt:choose >
<xslt:when test="m:menu-item" >
<xslt:call-template name="menu-item-as-nav-link" >
<xslt:with-param name="menu-item" select="m:menu-item" />
</xslt:call-template>
</xslt:when>
<xslt:otherwise ><xslt:value-of select="./@rdf:ID"
/></xslt:otherwise>
</xslt:choose></span>
</xslt:for-each>
</div>
</xslt:template>

Jul 20 '05 #2
ted
I'm using a lot of named template and variables. Stopped working with XSL
for a couple of months. Came back and it took me a while to figure out what
I originally wrote. Probably bad code (and commenting), but was wondering
if larger jobs are better served using XSLT in conjuction with Java. I find
myself wanting to put things in arrays and hashes sometimes. But maybe it's
because I don't know my XSL well enough.

"Andy Dingley" <di*****@codesm iths.com> wrote in message
news:q6******** *************** *********@4ax.c om...
On Wed, 27 Aug 2003 10:09:13 GMT, "ted" <te************ @yahoo.com>
wrote:
Was wondering if XSLT alone is appropriate for the following situation.


Yes.
From XML, I'm creating a small website (around 50 pages) with pages that
link to each other through a nav menu and a "crumb-trail" of links.


I did this a few years back. As I don't reckon much to XML's IDREF for
representing graph structures, I used RDF instead.

To handle the "context switching", I used a good many variables, most
of which were passed as parameters to named templates.

For the breadcrumb trail itself, I just used an axis of
ancestor-or-self::

<!-- Breadcrumb trails -->

<xslt:templat e name="breadcrum bs" >
<xslt:param name="Applicati on" select="/.." />
<!-- Display a "breadcrumb " trail (as described by Nielsen) to show
where the Application is in the overall hierarchy -->

<div id="divBreadcru mbs" >
<xslt:for-each
select="$Applic ation/ancestor-or-self::*[substring-after(@rdf:type ,
'#')='Applicati on']" >
<xslt:if test="position( )!=1" > -&gt; </xslt:if>
<span class="applicat ion" ><xslt:choose >
<xslt:when test="m:menu-item" >
<xslt:call-template name="menu-item-as-nav-link" >
<xslt:with-param name="menu-item" select="m:menu-item" />
</xslt:call-template>
</xslt:when>
<xslt:otherwise ><xslt:value-of select="./@rdf:ID"
/></xslt:otherwise>
</xslt:choose></span>
</xslt:for-each>
</div>
</xslt:template>

Jul 20 '05 #3

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

Similar topics

1
1405
by: Jeff Kish | last post by:
Hi. Can someone tell me when xslt, xpath, xquery are appropriate technologies to consider? I really know nothing about xslt except it is about transforming xml, (but I'm about to embark on a learning campaign). As you may have noticed from other postings, I know a very small amount about XQuery (and thus XPath).
0
380
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of information: It fails on any method that it happens to hit first. I juggled the methods a bit, and it just doesn't matter. As soon as the XslTransform hits an extension function, it fails with an invalid argument exception.
4
1455
by: MGG | last post by:
Hi, Can anybody help me to create a xslt for the following xml matter. <orderedlist numeration="arabic"> <listitem> <para>An insurance policy paid 12 months in advance is treated as an asset because</para> <orderedlist numeration="upperalpha"> <listitem>
3
2258
by: Jack Fox | last post by:
I've never had the need to work with XML, but I believe I now have an appropriate application. I have time-series data in objects organized as a tree that I want an ASP.NET program to write out to web pages formatted as a matrix. It is not a simple matrix, since the number of row heading cells can vary, but the data cells must be aligned by date (so the heading cells will not be uniformly sized). example of typical rows: 3 heading...
5
1494
by: RicercatoreSbadato | last post by:
I want to load a table with 2 columns from an xml file. Is it possible with xslt to sort the columns by clicking on their header ?
2
1282
by: super todd | last post by:
Here is the deal. We have an ASP.NET page which does an XSLT transform. Both the XSL and the XML come off a unc path on another server. All annonymous accaess has been permissioned accordingly. In addition aspnet_setreg.exe has been downloaded and been run to give the applications the appropriate permissions. I feel it has something to do with trusted sites. If I change the code to pass evidence to the XslTransform load (the good...
9
1777
by: daph4ntom | last post by:
Right, I need some some views on the pros and cons of using XSLT versus ASP.NET 2.0 for the Presentation layer of an app. My company are looking at creating multiple sites and multi lingual support going forward... I have looked at Chris Lovetts post http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnexxml/html/xml02192001.asp Some of his views are still relevant.
3
1748
by: Carles Company Soler | last post by:
Hello, I want to calculate the value of an attribute. For example <rect x="2+3" y="12"and be <rect x="5" y="12">. Is it possible using XSLT? Thanks!
15
4345
by: Zhang Weiwu | last post by:
http://www.w3.org/MarkUp/2004/xhtml-faq provided a trick to serve xhtml webpage to IE as application/xml I used that trick and now every one of my xhtml webpage have following first 4 starting lines: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="curseIE.xsl"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
0
8638
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
9120
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...
0
8998
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
8854
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
7668
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...
0
5841
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
4584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2278
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1979
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.