473,404 Members | 2,178 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,404 software developers and data experts.

[XSL] : use array variable in XSL stylesheet

MC
Hi to all,

I would like to use in a XSL stylesheet an array variable which is
defined in a Java program.

For example, in my program, i defined a tab variable
String[] tab = {"first", "second", "third"};

which i pass to the XSLT processor like this :
transform.setParameter("tab", tab);

In my XSL stylesheet, i declare tab variable with <xsl:param
name="tab"/> and I would like for example to get the second element of
the tab.

Is it possible ? I try <xsl:value-of select="$tab[1]"/> but I've an error.

More generally, is it possible to use in XSL stylesheet arrays objects,
Hashmap, .. and JavaBeans ?

Thanks a lot for your answers

Marie
Jul 20 '05 #1
1 3065
MC <mc*****@hotmail.com> writes:
Hi to all,

I would like to use in a XSL stylesheet an array variable which is
defined in a Java program.

For example, in my program, i defined a tab variable
String[] tab = {"first", "second", "third"};

which i pass to the XSLT processor like this :
transform.setParameter("tab", tab);

In my XSL stylesheet, i declare tab variable with <xsl:param
name="tab"/> and I would like for example to get the second element of
the tab.

Is it possible ? I try <xsl:value-of select="$tab[1]"/> but I've an error.

More generally, is it possible to use in XSL stylesheet arrays objects,
Hashmap, .. and JavaBeans ?

Thanks a lot for your answers

Marie

The mapping between types in the external system and types within XSLt
is purely a feature of the system you are using (you don't say which
that is), so it depends on that system. Generally though, especially if
you want to use [1] notation, I'd have thought that you would have a
better chance of things working smoothly if you construct a tree
structure (DOM of some sort) in the external code first and then rely on
the API's mapping of external DOM fragments to Xpath node sets.

David
Jul 20 '05 #2

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

Similar topics

1
by: Mitch Cunningham | last post by:
HI, i am trying to use the following code to do an xslt transform using php 4/sablotron with additional optional arguments. can anybody tell me what i am doing wrong ? i was expecting the...
5
by: Buchleitner Martin | last post by:
Hi! I got another problem parsing my XML document: <document> <paragraph> <style val=listing/> <text>listing #1 text</text> </paragraph> <paragraph>
1
by: Luke Airig | last post by:
I have an xsl stylesheet that merges data from two files based upon a common date/time field. Right now, one of the file names is hard-coded in the xsl file. Is there any way to make this...
1
by: Luke Airig | last post by:
I am using the Saxon 6.5.3 engine and I have an xsl stylesheet that merges two files on a date_time field and writes out a tab-delimited flat file. My working version has a hard-coded file name in...
8
by: Sebastian Kerekes | last post by:
Greetings, I'm developing an application that supports multiple languages. In my XSL I use variables to place the text where it belongs to. At the top of the document I include those variables -...
1
by: discomiller | last post by:
Mario Mueller: Hello *, radiobuttons belong to other radiobuttons by the "name="any_value"" attribut. Thats a fakt. I got the following XML:...
3
by: Blaise Garant | last post by:
Hi I've made a stylesheet to transform my data into XSL-FO. This stylesheet used to work with MSXSL 4.0 but I've got some issues in ..NET. First, I changed removed all the "node-set()" function...
14
by: ajfish | last post by:
Hi, I am trying to allocate a unique ID to every instance of tag 'foo' in a large XML document. currently I'm doing this: <xsl:variable name="UniqueId"> <xsl:number count="foo" level="any"/>...
5
by: jhurrell | last post by:
I have been having some trouble getting my XSL style sheet to parse correctly. I have some XML outputted from an SQL-Server, that I then need to turn into multiple HTML files. This I have done...
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: 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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.