Author Topic: XSL help  (Read 573 times)

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
XSL help
« on: June 08, 2007, 04:55:34 AM »
Is anyone here good at or familiar with XSL?  (Stylesheets for XML code)

I'm looking to read through each line in the XML, and concatenate all of the contents (including tags) into one line in the output.  For instance, if I give it this:

<APS>
  <Thread>
     <Post>This is post one!</Post>
  </Thread>
</APS>

I want it to output:

<APS><Thread><Post>This is post one!</Post></Thread></APS>

I know that <xsl:copy-of select="*"/> gets me close, but it preserves the hard returns in the XML.  I was thinking about using a for-each loop and concatenating each line, but I can't find how to print the variable value and the opening and closing tags.

Thoughts, or am I asking the wrong group?

Thanks!

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
Re: XSL help
« Reply #1 on: June 08, 2007, 05:32:44 AM »
Got it.  For furture reference:

<xsl:for-each select="*"><xsl:copy-of select="."/></xsl:for-each>

Thanks!