Re: [xsl] read records from database in XSLT

Subject: Re: [xsl] read records from database in XSLT
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Wed, 15 May 2002 01:24:18 +0200
It's not possible in XSLT, you need extensions. Either in XSLT (like for XALAN) or a servlet which evaluates your expressions and returns the XML.



Ming schrieb:

I have a question regarding reading records from a database in XSLT.

I have the following xml file:

<file db="db1" name="/record/2233/21/1/12_mmish"  />
<file db="db2" name="/record/2233/21/2/34_ytrrm"  />

And the name attribute is a key in a mysql table. What I want is the
value of the key. So, I can use "select recordvalue from Record where
keyvalue = '/record/2233/21/1/12_mmish'" to get the record value from
the table.

The record value is actually in xml format like this:
   <title> title1 </title>

What I need is to read the whole value in my stylesheet using something
like <xsl:variable name='record' select="document(@name)/xml"/>. But
since the name attribute is not the path to a xml file, I cannot use
this method.

Can anyone give me some suggestions on how to approach this or some
information I can know more about using queries in my stylesheet?

Thanks a lot.


XSL-List info and archive:

Current Thread