[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

flat file transform (one more stupid novice question,

Subject: flat file transform (one more stupid novice question, sorry)
From: "Philipp Chudinov" <morpheus@xxxxxxxx>
Date: Wed, 19 Sep 2001 16:27:56 +0600
file transform
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
blah</paragraph>
      <header3>H3 element</header3>
      <paragraph type="text">Blah blah blah</paragraph>
      <theader>table header</theader>
<!-- table omitted for brevity-->
      <xhtml:table id="N400076">
        <xhtml:tr>
          <xhtml:td>
            <paragraph>
            1</paragraph>
          </xhtml:td>
        </xhtml:tr>
      </xhtml:table>
      <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";
xlink:show="replace">Philipp</link></paragraph>
      <paragraph type="source">By<link xlink:type="simple" href="http://www.lenta.ru/"
xlink:show="replace">lenta.ru</link>.</paragraph>
</material>


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:
<material>
<header></header>
<subheader></subheader>
<lead></lead>
<text>
 <paragraph></paragraph>
 <h2></h2> <!-- //if there is any in any order-->
 <h3></h3> <!-- //if there is any-->
 <table></table> <!-- //if there is any-->
 <paragraph></paragraph>
 <commentary>
   <header></header>
   <text>
      <paragraph></paragraph>
      <paragraph></paragraph>
  </text>
 </commentary>
</text>
<author></author>
<source></source>
</material>

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.

Philipp.
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.