By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,214 Members | 2,072 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,214 IT Pros & Developers. It's quick & easy.

Can it be done using XSL?

P: n/a
I have a huge text file which contains a list of all possible services
that can be offered to the users. Let's say it looks like

<services>
<service>srv1</service>
<service>srv2</service>
</services>

But a user is not eligible for all the services. So if a user is
eligible only for service1 then his file will look like

<services>
<service>srv1</service>
</services>

The flags which govern whether the user is eligible for a service are
stored in a database. Is it possible to write an XSL stylesheet which
will inquire any database (including relational and flat file) to
output the final xml shown above. Or can it be done using Java?

Any help or pointers are welcome.

Thanx in advance,
richard
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 6 Apr 2004 13:55:37 -0700, gr******@hotmail.com (richard green)
wrote:
The flags which govern whether the user is eligible for a service are
stored in a database. Is it possible to write an XSL stylesheet which
will inquire any database (including relational and flat file) to
output the final xml shown above.
It's possible to do almost anything if you try hard enough....

XSL transforms XML into something else, usually XML. Every piece of
the source data is contained in the source document(s) and the
stylesheet. It can't do something like this on its own.

There are also XSL extensions, either proprietary or some emerging
open standards. These allow you to hook in snippets of JavaScript etc.
Very useful if you need some regexes to do the sort of string handling
that XSL and XPath are usually poor at. As it's just JavaScript (or
JScript), then you can also start connecting out to databases and from
their the world is your lobster.

I have done this in the past, when I had a problem that was basically
an XSL problem, but a lookup to expand a magic code into the current
DB lookup values. Eccentric, but it did the job.

But that isn't how I'd do this. This is a classic example of a simple
DB query / addition to a DOM. No XSL required, although you'll often
use some in a later step. Find an appropriate DOM for your language
choice and read the examples - there should be a suitable one pretty
early on.
Or can it be done using Java?


I did it about three times today, using ASP & JavaScript. A few months
back and I'd have been doing it in Java. Give it a few weeks and I
think I'm using PHP. Every viable language these days has ready
access to an XML DOM (languages that don't are on shaky ground)

--
Smert' spamionam
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.