[xsl] flat file transform (one more stupid novice question, sorry)

Subject: [xsl] flat file transform (one more stupid novice question, sorry)
From: "Philipp Chudinov" <morpheus@xxxxxxxx>
Date: Wed, 19 Sep 2001 16:27:56 +0600
Hi! I am sorry for this stupid question, I've checked both XSL FAQ and Jeni's XSLT pages, but still
can not apply methods from that pages to my case. Feelin like a lobotomized flatworm. Sorry. The
problem is: I need to wrap some piece of code with <text></text> tags.

 The source for transformation is:

<?xml version="1.0" encoding="UTF-8"?>
<material xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:xlink="http://www.w3.org/1999/xlink";>
      <header>Material header</header>
      <subheader>Material subheader</subheader>
      <paragraph type="lead">Material lead</paragraph>
      <header2>H2 element</header2>
      <paragraph type="text">Blah blah blah <xhtml:strong>Blah blah blah</xhtml:strong>Blah blah
      <header3>H3 element</header3>
      <paragraph type="text">Blah blah blah</paragraph>
      <theader>table header</theader>
<!-- table omitted for brevity-->
      <xhtml:table id="N400076">
      <paragraph type="text">Blah blah blah</paragraph>
      <commentaryheader>Header of a commentary</commentaryheader>
      <paragraph type="commentary">commentary</paragraph>
      <paragraph type="commentary">commentary</paragraph>
      <paragraph type="text">blah blah</paragraph>

      <paragraph type="author"><link xlink:type="simple" href="mailto:morpheus@xxxxxxxx";
      <paragraph type="source">By<link xlink:type="simple" href="http://www.lenta.ru/";

All I need is to wrap all p[@type='text'], h2, h3, commentary with <text></text> tags. The problem
is that everything - table, commentary should also be placed inside <text> tag in an appropriate
order. In other words, the structure should be very simple:
 <h2></h2> <!-- //if there is any in any order-->
 <h3></h3> <!-- //if there is any-->
 <table></table> <!-- //if there is any-->

I feel that it could be made in a very simple way, but do not see, how :( sorry for a stupid
question once again. Please, help me.

P.S. or, maybe, I should use one stylesheet to process everything except <text></text> and another
to process all <text> stuff??? still no good idea... :(

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread