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

RE: Result tree fragment to string?

Subject: RE: Result tree fragment to string?
From: "Garriss Jr., James P." <jgarriss@xxxxxxxxx>
Date: Wed, 27 Aug 2008 13:54:06 -0400
RE:  Result tree fragment to string?
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?)

James Garriss
http://garriss.blogspot.com



-----Original Message-----
From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx]
Sent: Wednesday, August 27, 2008 12:09 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Result tree fragment to string?

2008/8/27 Garriss Jr., James P. <jgarriss@xxxxxxxxx>:
> I have a variable that contains a result tree fragment of HTML code.
I
> need to convert the result tree fragment to a string.  The string
must
> not only include the text node values but the HTML element names and
> attributes as well.

Does:

<xsl:copy-of select="$var"/>

...do what you need?  If not post back with an example because it's
not that clear what you are after...


--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.