472,363 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,363 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 3813
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.