You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by MAHE Vincent FTRD/DIH/REN <vi...@rd.francetelecom.fr> on 2001/03/20 08:41:50 UTC

XSL question

I have the following tree :

<DIR ref="voila">
	<DIR ref="assisant">
		<DIR ref="noyau">
			<FILE ref="sample_1" ext=".html" info="blabla"/>
			<FILE ref="sample_2" ext=".html" info="blabla"/>
			<FILE ref="sample_3" ext=".html" info="blabla"/>
		</DIR>
	</DIR>
	<DIR ref="ftpweb">
		<DIR ref="noyau">
			<FILE ref="sample_1" ext=".html" info="blabla"/>
			<FILE ref="sample_2" ext=".html" info="blabla"/>
			<FILE ref="sample_3" ext=".html" info="blabla"/>
		</DIR>
	</DIR>
</DIR>

I would like to transform it via XSL to the following tree :

<FILE path="voila/assistant/noyau/sample_1" ext=".html" info="blabla"/>
<FILE path="voila/assistant/noyau/sample_2" ext=".html" info="blabla"/>
<FILE path="voila/assistant/noyau/sample_3" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_1" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_2" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_3" ext=".html" info="blabla"/>

Do you think it's possible via XSL ?
In particular, is it possible to concatenate an xsl variable by its own
content in order to obtain something like this :
	$my_string = $my_string + @ref

Is it possible to declare global variable with XSL (i.e. variable which are
common to several XSL templates) ?

Thanks


Vincent

Re: XSL question

Posted by John Gentilin <jo...@eyecatching.com>.
To further the Xalan effort and to see if I could do this without
looking at the book. It may not be the best but it works.

If you are getting into XSL (as everyone else said),  XSLT Prog Ref
by Mike Kay and The XSL Companion by Neil Bradley are worth
reading.  There are other newcomers out there,  haven't read them
though.

Welcome to Xalan
JG


MAHE Vincent FTRD/DIH/REN wrote:

> I have the following tree :
>
> <DIR ref="voila">
>         <DIR ref="assisant">
>                 <DIR ref="noyau">
>                         <FILE ref="sample_1" ext=".html" info="blabla"/>
>                         <FILE ref="sample_2" ext=".html" info="blabla"/>
>                         <FILE ref="sample_3" ext=".html" info="blabla"/>
>                 </DIR>
>         </DIR>
>         <DIR ref="ftpweb">
>                 <DIR ref="noyau">
>                         <FILE ref="sample_1" ext=".html" info="blabla"/>
>                         <FILE ref="sample_2" ext=".html" info="blabla"/>
>                         <FILE ref="sample_3" ext=".html" info="blabla"/>
>                 </DIR>
>         </DIR>
> </DIR>
>
> I would like to transform it via XSL to the following tree :
>
> <FILE path="voila/assistant/noyau/sample_1" ext=".html" info="blabla"/>
> <FILE path="voila/assistant/noyau/sample_2" ext=".html" info="blabla"/>
> <FILE path="voila/assistant/noyau/sample_3" ext=".html" info="blabla"/>
> <FILE path="voila/ftpweb/noyau/sample_1" ext=".html" info="blabla"/>
> <FILE path="voila/ftpweb/noyau/sample_2" ext=".html" info="blabla"/>
> <FILE path="voila/ftpweb/noyau/sample_3" ext=".html" info="blabla"/>
>
> Do you think it's possible via XSL ?
> In particular, is it possible to concatenate an xsl variable by its own
> content in order to obtain something like this :
>         $my_string = $my_string + @ref
>
> Is it possible to declare global variable with XSL (i.e. variable which are
> common to several XSL templates) ?
>
> Thanks
>
> Vincent

RE: XSL question

Posted by Christian Aberger <xm...@Aberger.at>.
Hey, there have been written books on that xslt topic. Why don't you read on
of these, this is much more comprehensive than a short mail-answer can be,
there are a lot of them. E.g. "XSLT Programmer's Reference" by Michael Kay,
ISBN 1-861003-12-9 at and half a dozen of others?

wfR ChrisA

-----Original Message-----
From: MAHE Vincent FTRD/DIH/REN
[mailto:vincent.mahe@rd.francetelecom.fr]
Sent: Dienstag, 20. März 2001 08:42
To: 'xalan-dev@xml.apache.org'
Subject: XSL question


I have the following tree :

<DIR ref="voila">
	<DIR ref="assisant">
		<DIR ref="noyau">
			<FILE ref="sample_1" ext=".html" info="blabla"/>
			<FILE ref="sample_2" ext=".html" info="blabla"/>
			<FILE ref="sample_3" ext=".html" info="blabla"/>
		</DIR>
	</DIR>
	<DIR ref="ftpweb">
		<DIR ref="noyau">
			<FILE ref="sample_1" ext=".html" info="blabla"/>
			<FILE ref="sample_2" ext=".html" info="blabla"/>
			<FILE ref="sample_3" ext=".html" info="blabla"/>
		</DIR>
	</DIR>
</DIR>

I would like to transform it via XSL to the following tree :

<FILE path="voila/assistant/noyau/sample_1" ext=".html" info="blabla"/>
<FILE path="voila/assistant/noyau/sample_2" ext=".html" info="blabla"/>
<FILE path="voila/assistant/noyau/sample_3" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_1" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_2" ext=".html" info="blabla"/>
<FILE path="voila/ftpweb/noyau/sample_3" ext=".html" info="blabla"/>

Do you think it's possible via XSL ?
In particular, is it possible to concatenate an xsl variable by its own
content in order to obtain something like this :
	$my_string = $my_string + @ref

Is it possible to declare global variable with XSL (i.e. variable which are
common to several XSL templates) ?

Thanks


Vincent