RE: [xsl] Result tree fragment to string?

Subject: RE: [xsl] Result tree fragment to string?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 27 Aug 2008 16:13:15 -0400
James,

At 01:54 PM 8/27/2008, you wrote:
If I were simply outputting the contents of the variable, then yes,
this
would be fine.  But I want to do some string processing first, so no, I
don't think this is what I need.

Here's a contrived example that demonstrates what I need:

    <xsl:variable name="rtf">
      <html>
        <body>
          <div class="alpha">Alpha</div>
          <div class="bravo">Bravo</div>
          <div class="alpha">Alpha</div>
        </body>
      </html>
    </xsl:variable>

I need to send this variable, $rtf, to a named template, where I intend
to
eliminate the redundant <div>.  Note that I have been forbidden to dork
with
the variable code itself; someone else maintains it.  (Have I mentioned
that
my development environment is constricting?)

In other words, you need to modify the RTF but you are forbidden to modify the code that generates it? :-)


For this, you really have no choice but use XSLT 2.0, a node-set() extension in 1.0, or output the RTF (along with whatever else you need) as an intermediate result to be processed in a discrete step.

Or is it possible simply to override the logic that generates it with your own, or bypass it entirely?

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread