xsl-list
[Top] [All Lists]

RE: Making flat files strucutred hierarchically

2004-10-06 08:29:41
Try a google for "XSLT positional grouping".

Michael Kay
http://www.saxonica.com/
 

-----Original Message-----
From: Huditsch Roman [mailto:Roman(_dot_)Huditsch(_at_)lexisnexis(_dot_)at] 
Sent: 06 October 2004 15:37
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Making flat files strucutred hierarchically

Hi,

 

I am in search for a comfortable way for sructuring flat files.

Please take this source document as an example:

 

<?xml versio="1.0"?>

<root>

   <title>Titel 1</title>

  <para>Para 1</para>

  <para>Para 2</para>

  <para>Para 3</para>

  <title>Title 2</title>

  <para>Para 1</para>

  <para>Para 2</para>

  <title>Title 3</title>

  <para>Para 1</para>

  <para>Para 2</para>

</root>

 

After my XSLT 1,0 transformation the output should look like

 

<?xml versio="1.0"?>

<root>

   <layer>

     <title>Titel 1</title>

     <para>Para 1</para>

     <para>Para 2</para>

     <para>Para 3</para>

  </layer>

  <layer>

    <title>Title 2</title>

    <para>Para 1</para>

    <para>Para 2</para>

  </layer>

  <layer>  

    <title>Title 3</title>

    <para>Para 1</para>

    <para>Para 2</para>

  </layer>

</root>

 

Is there any way to do this? I don't know how to define "take 
all "para" nodes up to the next "title" element.....

Can you help me?

Thank you very much in advance.

 

Wbr,

Roman



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--





<Prev in Thread] Current Thread [Next in Thread>