473,385 Members | 1,610 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.

Need help with xml and xsl design

Hi all
This is what I have in mind and I will appreciate any suggestions.

I am trying to create a xml help system for my application. The schema of
the xml file will be
<helpsystem>
<help id="unique id">
<text>text data</text>
<link
href="optional tag which will hold a reference to a uri"
helpanchor="this is also a optional attribute which will point
to a helpid in the same document or a different document"
helpanchorhtmlfile=" this attribute will only be present if the
helpachor attribute is there and basically will include a html file name"
some text data </link>

</help>
(any number of help tags)
</helpsystem>

At runtime this xml will be read and it will be transform to html. Each help
tag will become a html table and each child of the help tag will become a
row for the html table.

The link tag will either have href attribute or helpanchor attribute but not
both. The link tag trasform to a html <a> tag. The href attribute of the
link tag transform to the href attribute of <a>and the <link> text becomes
the text for the <a> tag. When the helpanchorhtmlfile attribute is present,
the href attribute of <a> will hold the reference given by this tag.

All this is very easy( have already written the xsl stylesheet for it) when
the link tag has the attribute href. My difficulty comes when the link tag
has helpanchor attribute because for this attribute I have to generate a
seperate html file with the name given in the helpanchorhtmlfile attribute.
Since the help id which the helpanchor is pointing itself could have any
number of link, I have to build html files for any number of nested levels.

In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl. If any of you have any
suggestions please let me know and I will greatly appreciate your help.

Rafia Tapia

Rafia Tapia
Nov 11 '05 #1
22 2539
Rafia Tapia wrote:
All this is very easy( have already written the xsl stylesheet for it) when
the link tag has the attribute href. My difficulty comes when the link tag
has helpanchor attribute because for this attribute I have to generate a
seperate html file with the name given in the helpanchorhtmlfile attribute.
Since the help id which the helpanchor is pointing itself could have any
number of link, I have to build html files for any number of nested levels. Does this explanation mean you need to produce multiple outputs from single
transformation and that's your problem?
In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl.

Never heard of any problem with recursion in XSLT.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Hello Oleg,
In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl.

Never heard of any problem with recursion in XSLT.


Although if you're going to want to maintain state (e.g. recursion level)
you'll need to get creative. XSL is not very friendly toward state
maintenance since templates aren't supposed to produce any side effects
other than their transformation output.

- Joe Geretz -
Nov 11 '05 #3
> Still, if you attempt to "maintain a state," it is a problem.

You shouldn't.

In XSLT one does not attempt to maintain state -- and this is not a problem.
If you want to use XSLT like you are using Fortran, then it is better for
you to continue to use Fortran.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #4

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
Still, if you attempt to "maintain a state," it is a
problem.
You shouldn't.

In XSLT one does not attempt to maintain state -- and this is not a problem. If you want to use XSLT like you are using Fortran, then it is better for you to continue to use Fortran.


You've made this point repeatedly clear.
Nov 11 '05 #5
Hello Dimitre,
Still, if you attempt to "maintain a state," it is a problem.


You shouldn't.


Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove
my statement' all you need to know is that you can initialize a variable but
you can't make further asignment to change its value. Thus, it's obviously
difficult to track state.

If you'd like to see how I solved this problem, here's a nice practical
template which demonstrates A - the possibility of tracking the recursion
level and B - the difficulty in doing so. (No, I did not come up with this
technique myself, I read it in a book.)

<xsl:template name="indent">
<xsl:param name="nodenum"/>
<xsl:param name="pos"/>
<xsl:if test="substring($nodenum, $pos, 1) = '.' ">
<img border="0" src="images/pixel.gif" width="15" height="9"/>
</xsl:if>
<xsl:if test="$pos != string-length($nodenum)">
<xsl:call-template name="indent">
<xsl:with-param name="nodenum" select="$nodenum"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion.

I think that we can all agree that state maintenance is difficult with XSLT.
And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it
is sometimes necessary and when it is, it is difficult.

- Joe Geretz -
Nov 11 '05 #6
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.
Once again, "state maintenance" meaning the capability to alter the contents
of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:ub**************@TK2MSFTNGP12.phx.gbl...
Hello Dimitre,
Still, if you attempt to "maintain a state," it is a problem.
You shouldn't.


Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to

'prove my statement' all you need to know is that you can initialize a variable but you can't make further asignment to change its value. Thus, it's obviously
difficult to track state.

If you'd like to see how I solved this problem, here's a nice practical
template which demonstrates A - the possibility of tracking the recursion
level and B - the difficulty in doing so. (No, I did not come up with this
technique myself, I read it in a book.)

<xsl:template name="indent">
<xsl:param name="nodenum"/>
<xsl:param name="pos"/>
<xsl:if test="substring($nodenum, $pos, 1) = '.' ">
<img border="0" src="images/pixel.gif" width="15" height="9"/>
</xsl:if>
<xsl:if test="$pos != string-length($nodenum)">
<xsl:call-template name="indent">
<xsl:with-param name="nodenum" select="$nodenum"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion.

I think that we can all agree that state maintenance is difficult with XSLT. And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it is sometimes necessary and when it is, it is difficult.

- Joe Geretz -

Nov 11 '05 #7
Joseph Geretz wrote:
Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove
my statement' all you need to know is that you can initialize a variable but
you can't make further asignment to change its value. Thus, it's obviously
difficult to track state. Actually that's really bad idea to to solve any problem in XSLT by emulating
assignable variables. Obviously it's difficult to go against the way a
language is designed to be used.
In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion. All we know educational samples sometimes are really weird :) I'm sure there
is a better way to solve that problem. If the level of recursion cannot be
calculated using usual means, why not merely to pass it as a parameter?
I think that we can all agree that state maintenance is difficult with XSLT.
And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it
is sometimes necessary and when it is, it is difficult.

Well, may be that's not so bad if only 3% of activity can be somewhat difficult?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #8

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be a much more straightforward solution than "counting the dots via recursion". And no state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.

Once again, "state maintenance" meaning the capability to alter the contents of a variable, the value of which is some current state, is only needed by people, who want to solve a problem in a procedural/imperative (non-functional) way.


The original poster has not responded yet. So far, all but one
of the messages in this conversation is amongst respondents.
It's my best guess that Joseph and I both understand the
stateless nature of XSLT -- so mission accomplished.
Nov 11 '05 #9
Hi all
Thanks for all your post. I was able to accomplish my task using dom. I am
not even sure what you mean by state maintainence. but below I am producing
the simplified version of my xml and xsl

helpsystem.xml

<helpsystem>
<help id="a">
<text>A text</text>
<link href="abc.com">B text</link>
</help>
<help id="b">
<text>C text</text>
<link href="xyz.com">D text</link>
<link helpanchor="a" href="myhtmlfile.html"> E text </link>
</help>
<help id="c">
<link helpachor="b" href="myotherhtml.html" >F text </link>
</help>
</helpsystem>

helpsystem.xsl

<xsl:template match="Link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="@href"/>
</xsl:attribute>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>

<xsl:template match="Text">
<xsl:value-of select="."/>
</xsl:template>

Now I start by looking at help id ="c" which will produce the following html
<a href="myotherhtml.html>F text </a>

The problem is myotherhtml.html file has to be generated dynamically. This
html will look like
C text
<a href="xyz.com">D text</a>
<a href="myhtmlfile.html"> E text </a>

and again in this dynamically created html above, there is another link for
a dynamically created html. When I said recusion, what I meant that the html
generation should happen at each nested level.

I am not sure if this could be accomplish by plain xslt. I am using xslt
with dom and it is working. but anyway thanks a lot to all of you for your
input.

Rafia

"Grinder" <gr*****@no.spam.maam.com> wrote in message
news:ub*************@TK2MSFTNGP10.phx.gbl...

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be

a much more
straightforward solution than "counting the dots via

recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the

transformation satisfy.


Once again, "state maintenance" meaning the capability to

alter the contents
of a variable, the value of which is some current state, is

only needed by
people, who want to solve a problem in a

procedural/imperative
(non-functional) way.


The original poster has not responded yet. So far, all but one
of the messages in this conversation is amongst respondents.
It's my best guess that Joseph and I both understand the
stateless nature of XSLT -- so mission accomplished.

Nov 11 '05 #10
> I don't think you explained clearly what is the problem.

There is no problem at all. You asked for a practical example of where state
maintenance would be desirable during a transformation. I've given it to
you. In order to properly indent, you need to know the level of recursion
you are on.
From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.
Yes, just guesses. Come up with a better solution and post it. The code I
presented is based on the solution from XSLT 2nd Edition by Kay.
Once again, "state maintenance" meaning the capability to alter the contents of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.


OK, so show us how to solve this in the functional way.

- Joe Geretz -
Nov 11 '05 #11
> Well, may be that's not so bad if only 3% of activity can be somewhat
difficult?

Not so bad? Who said it was bad? It's EXCELLENT!

- Joe Geretz -

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Joseph Geretz wrote:
Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove my statement' all you need to know is that you can initialize a variable but you can't make further asignment to change its value. Thus, it's obviously difficult to track state. Actually that's really bad idea to to solve any problem in XSLT by

emulating assignable variables. Obviously it's difficult to go against the way a
language is designed to be used.
In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of recursion. All we know educational samples sometimes are really weird :) I'm sure

there is a better way to solve that problem. If the level of recursion cannot be
calculated using usual means, why not merely to pass it as a parameter?
I think that we can all agree that state maintenance is difficult with XSLT. And purists can argue all they want that you shouldn't be tracking state, and I agree that 97% of all my XSLT hasn't needed state maintenance, but it is sometimes necessary and when it is, it is difficult. Well, may be that's not so bad if only 3% of activity can be somewhat

difficult? --
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel


Nov 11 '05 #12
> > I don't think you explained clearly what is the problem.

There is no problem at all. You asked for a practical example of where state
maintenance would be desirable during a transformation. I've given it to
you. In order to properly indent, you need to know the level of recursion
you are on.
No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.

From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.
Yes, just guesses. Come up with a better solution and post it.


Better solution to what? To the unspecified problem?
The code I
presented is based on the solution from XSLT 2nd Edition by Kay.
You presented just one template with two xsl:param elements with undefined values...

No source xml document.

No desired output.

Really no formulation of the problem.
Shall I beg for you to specify the problem you want solved?
Once again, "state maintenance" meaning the capability to alter the contents
of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.


OK, so show us how to solve this


What is "this"?
in the functional way.

- Joe Geretz -

Nov 11 '05 #13
> No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.


Like, do I owe you something dude? Get a job. You'll find that your
fascination with the thoeretical will diminish once you have something
practical to spend your time on.

- Joe Geretz -
Nov 11 '05 #14
Hi Chris,
As Dimitre does point out (although not particularly clearly in the midst of the rising flames) it is nearly always possible [I think Dimitre usually
asserts that it *is* always possible] to achieve something in XSLT without
state that would otherwise in a scripted environment require it.
Dimitre's reference to XSLT as a functional language is correct but
unfortunately the solutions are sometimes so esoteric and bloody difficult
to fathom (nevermind code) that they are usually missed.


Which was exactly my point. I never said that anything was impossible to
accomplish. Just pointed out that sometimes certain tasks are difficult to
accomplish. This is true of any development environment I've ever worked
with. Why choose VB for one task and C++ for another? It's not that
windowing is impossible in C++ or that pointers and callbacks are impossible
with VB. It's just that windowing is more convenient with VB and pointers
and callbacks are more convenient with C++.

The fact that XSL works in a functional, rather than in a procedural manner,
is simply that - a fact. It neither condemns, nor recommends the language.
What it does mean though is that XSL is more suitable to those problems
which can be conveniently solved in a functional manner, and less suitable
to those tasks which cannot be conveniently solved in this manner.

- Joe Geretz -
Nov 11 '05 #15
So you failed to provide any concrete problem that requires maintaining
/altering state.

Although expected it's a pity.
"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.


Like, do I owe you something dude? Get a job. You'll find that your
fascination with the thoeretical will diminish once you have something
practical to spend your time on.

- Joe Geretz -

Nov 11 '05 #16
> So if you want
to go ahead and develop a word processor or spreadhseet application in XSLT go ahead, I won't attempt to stop you. It's probably even 'possible'. Let us know when you're done.


No need to let you know.

Much more challenging applications have already been developed with
functional languages by people with imagination.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #17

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
So if you want
to go ahead and develop a word processor or spreadhseet
application in XSLT
go ahead, I won't attempt to stop you. It's probably even
'possible'. Let us
know when you're done.
No need to let you know.

Much more challenging applications have already been

developed with functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?
Nov 11 '05 #18
"Grinder" <gr*****@no.spam.maam.com> wrote in message news:<eH**************@TK2MSFTNGP10.phx.gbl>...
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
So if you want
to go ahead and develop a word processor or spreadhseet application in
XSLT go ahead, I won't attempt to stop you. It's probably even 'possible'. Let
us know when you're done.


No need to let you know.

Much more challenging applications have already been

developed with
functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?


Compilers and compiler-writing systems

Natural Language Recognition and Speech Recognition Systems

Theorem Provers

Computer Algebra

Games (a chess program, Quake, etc.), a games development kit

Animation

Reactive animation

Musical Composition.

Robotic Control systems

Web Servers

Operating system (smart-card)
See for example:

http://www.research.avayalabs.com/us...rld/index.html

and

http://www.haskell.org/practice.html


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #19
Heh,
See for example:

http://www.research.avayalabs.com/us...rld/index.html
And every one a best seller!

Just for kicks I took a look at the link

Functional Programming in the Real World
Here is a list of functional programs applied to real-world tasks...

OK, but is anyone in the real world actually using any of these programs? I
see here that there's a neat FTP client. Hmm, let's check it out:

http://www.research.avayalabs.com/us...d/anonftp.html

LOL, it says here that as of September 1994 there was one person using this.
I bet by now millions of people are using this. Probably the author is too
busy distributing this popular FTP client to update the page since 1994.

ROTFLMHO!

Bottom line - it's important not to confuse possibility with suitability.
Unless of course, you live in an ivory tower.

(It's an odd sort of agenda, to be promoting functional programming as being
suitable for as broad a range of development tasks as are declarative
languages.)

- Joe Geretz -

"Dimitre Novatchev" <di******@eurosport.com> wrote in message
news:5f**************************@posting.google.c om... "Grinder" <gr*****@no.spam.maam.com> wrote in message

news:<eH**************@TK2MSFTNGP10.phx.gbl>...
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
> So if you want
> to go ahead and develop a word processor or spreadhseet

application in
XSLT
> go ahead, I won't attempt to stop you. It's probably even

'possible'. Let
us
> know when you're done.

No need to let you know.

Much more challenging applications have already been

developed with
functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?


Compilers and compiler-writing systems

Natural Language Recognition and Speech Recognition Systems

Theorem Provers

Computer Algebra

Games (a chess program, Quake, etc.), a games development kit

Animation

Reactive animation

Musical Composition.

Robotic Control systems

Web Servers

Operating system (smart-card)
See for example:

http://www.research.avayalabs.com/us...rld/index.html

and

http://www.haskell.org/practice.html


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

Nov 11 '05 #20
OK, but is anyone in the real world actually using any of these programs?


Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming
language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language for
large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony switches
are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a few
minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles Haskell to
either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables, existential
and universal quantification, unboxed types, exceptions, weak pointers, and
so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.
Nov 11 '05 #21
OK,

There's obviously a time and place for functional languages. I'm not saying
otherwise. However, it's just as obvious (to me at least) that functional
languages will lend themselves better to some tasks, and procedural
languages will lend themselves better to other tasks.

Which was the original premise; you can go back along the thread and look it
up. Simply my advice to the original poster that tracking state would be
difficult with XSL. (I remember how surprised I was personally to find this
out when I began using XSL.) I did not advise the original poster in any way
to either choose or reject XSL for his particular task. (Although, seemingly
others on the thread automatically jumped to the conclusion that that one
remark (which is after all, factual) reflected a condemnation of the
language for any purpose.)

In order to demonstrate the suitability of various languages for various
tasks, my original challenge was to produce a word processor or spreadsheet
application using XSL as the language medium. The premise is obviously
absurd (although I won't say impossible ;-). You answered showing that
functional languages (although not necessarily XSL) could be used to solve
such problems. I thank you for that, and I'll take a closer look at some of
these. I see several free versions of Haskell and I'd like to take a closer
look at this.

Once the flames die down (and I hope they have), hopefully we can all take
away the impression that different language mediums have different strengths
and weaknesses, and are threfore suitable for different types of tasks.
Personally, the application I am currently working on is a Win32 UI
application, however many areas of the UI display are actually embedded
browser areas which display HTML which is produced as the result of
XML/XSLT. So I use XSL for presentation purposes, however much of the
processing is performed in-code (VB6) before XML is emitted. (Which is what
confused me on a different thread when you refered to my VB code statements
as 'script'. I'm not working in a scripting environment (e.g. ASP, etc.))
Ultimately, in my current environment, for any given operation I have the
'luxury' of choosing to implement it at the presentation layer in XSL, or
further down in the business or data layers using procedural code. Sometimes
I'll choose to place even a UI operation at the highest level of my
procedural code (just before XML is emitted). It's not that these operations
are impossible to perform in XSL, it's just that often I'll get more 'bang
for the buck' by a procedural implementation, than by a functional one.

And sometimes it's vice versa. Obviously - otherwise I wouldn't be using XSL
in the first place to generate my UI. I don't need to. I can develop
standard Win32 forms. But I chose to take the XSL approach because it does
offer certain strengths.

- Joe Geretz -

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
OK, but is anyone in the real world actually using any of these
programs?
Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language for large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony switches
are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a few minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles Haskell to either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables, existential and universal quantification, unboxed types, exceptions, weak pointers, and so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.

Nov 11 '05 #22
Ice
I'm interested to hear how you are using XML/XSL to generate your screens,
if you could give me more information, I'd appreciate it!

ice
"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
OK,

There's obviously a time and place for functional languages. I'm not saying otherwise. However, it's just as obvious (to me at least) that functional
languages will lend themselves better to some tasks, and procedural
languages will lend themselves better to other tasks.

Which was the original premise; you can go back along the thread and look it up. Simply my advice to the original poster that tracking state would be
difficult with XSL. (I remember how surprised I was personally to find this out when I began using XSL.) I did not advise the original poster in any way to either choose or reject XSL for his particular task. (Although, seemingly others on the thread automatically jumped to the conclusion that that one
remark (which is after all, factual) reflected a condemnation of the
language for any purpose.)

In order to demonstrate the suitability of various languages for various
tasks, my original challenge was to produce a word processor or spreadsheet application using XSL as the language medium. The premise is obviously
absurd (although I won't say impossible ;-). You answered showing that
functional languages (although not necessarily XSL) could be used to solve
such problems. I thank you for that, and I'll take a closer look at some of these. I see several free versions of Haskell and I'd like to take a closer look at this.

Once the flames die down (and I hope they have), hopefully we can all take
away the impression that different language mediums have different strengths and weaknesses, and are threfore suitable for different types of tasks.
Personally, the application I am currently working on is a Win32 UI
application, however many areas of the UI display are actually embedded
browser areas which display HTML which is produced as the result of
XML/XSLT. So I use XSL for presentation purposes, however much of the
processing is performed in-code (VB6) before XML is emitted. (Which is what confused me on a different thread when you refered to my VB code statements as 'script'. I'm not working in a scripting environment (e.g. ASP, etc.))
Ultimately, in my current environment, for any given operation I have the
'luxury' of choosing to implement it at the presentation layer in XSL, or
further down in the business or data layers using procedural code. Sometimes I'll choose to place even a UI operation at the highest level of my
procedural code (just before XML is emitted). It's not that these operations are impossible to perform in XSL, it's just that often I'll get more 'bang
for the buck' by a procedural implementation, than by a functional one.

And sometimes it's vice versa. Obviously - otherwise I wouldn't be using XSL in the first place to generate my UI. I don't need to. I can develop
standard Win32 forms. But I chose to take the XSL approach because it does
offer certain strengths.

- Joe Geretz -

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
OK, but is anyone in the real world actually using any of these programs?

Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming
language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language

for
large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony

switches are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a

few
minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles

Haskell to
either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables,

existential
and universal quantification, unboxed types, exceptions, weak pointers,

and
so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.


Nov 11 '05 #23

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

Similar topics

4
by: Matt Stanley | last post by:
I am trying to build a page that scales to fit the browser window regardless of size or resolution. The navigation on the top of the page is framed in dark red/brown using CSS with a background...
39
by: Steven T. Hatton | last post by:
I came across this while looking for information on C++ and CORBA: http://www.zeroc.com/ice.html. It got me to wondering why I need two different languages in order to write distributed computing...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
7
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a...
2
by: David | last post by:
SUMMARY: If you don't want to read all of this, what I'm looking for more or less is ideas on how to implement websites using ASP.NET that have a templated look and feel and many pages that make...
3
by: vijaykokate | last post by:
Our company http://www.softnmation.com/ offers its customers a great variety of products. Everything you need can be found in this site. Web Template, CSS Template, Logo Template, Corporate...
2
by: Bob Heitzman | last post by:
I need to store data in, update, and read data from an XML file. An INI structure worked fine: a= 123 b= xyz c= etc
18
by: bsruth | last post by:
I tried for an hour to find some reference to concrete information on why this particular inheritance implementation is a bad idea, but couldn't. So I'm sorry if this has been answered before....
2
by: jmDesktop | last post by:
I'm using C#, but I don't know that it matters for this question. I know that many experienced folks are on here, so sorry for being off topic. I am finally at a point where I want to and I think...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...

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.