473,385 Members | 1,766 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,385 software developers and data experts.

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 3877
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:template name="breadcrumbs" >
<xslt:param name="Application" select="/.." />
<!-- Display a "breadcrumb" trail (as described by Nielsen) to show
where the Application is in the overall hierarchy -->

<div id="divBreadcrumbs" >
<xslt:for-each
select="$Application/ancestor-or-self::*[substring-after(@rdf:type,
'#')='Application']" >
<xslt:if test="position()!=1" > -&gt; </xslt:if>
<span class="application" ><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*****@codesmiths.com> wrote in message
news:q6********************************@4ax.com...
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:template name="breadcrumbs" >
<xslt:param name="Application" select="/.." />
<!-- Display a "breadcrumb" trail (as described by Nielsen) to show
where the Application is in the overall hierarchy -->

<div id="divBreadcrumbs" >
<xslt:for-each
select="$Application/ancestor-or-self::*[substring-after(@rdf:type,
'#')='Application']" >
<xslt:if test="position()!=1" > -&gt; </xslt:if>
<span class="application" ><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
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...
0
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...
4
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...
3
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...
5
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
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. ...
9
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...
3
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
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.