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

RE: Handling mixed content elements

Subject: RE: Handling mixed content elements
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Fri, 6 May 2005 09:45:55 +0100
RE:  Handling mixed content elements
> Interesting...
>
> If I understand you correctly, you've utilized an identity
> template. Very cool. Unfortunately, and I did not specify
> this in my original post, the structure of the XML document
> is about half narrative-like and half data-like. The identity
> template would be too broad to address it.
>
> Still, that was interesting. Thanks for the feedback.

Mukul was right, just let the power of xsl:apply-templates work for you:

This XML:

<paragraph>
  <bold>Actel</bold>
  (Sunnyvale, CA) will showcase its third-generation flash-based FPGA
device, ProASIC3 (see <italic>page 105</italic>)-said to be the
industry's lowest-cost FPGA, starting at $1.50. The company's Libero
integrated design environment and broad IP offerings will also be on
exhibit. Free workshops and demonstrations will be offered throughout
the show. (Booth #920,
http://info.edu/47)
  </paragraph>

With these templates:

<xsl:template match="paragraph">
	<p><xsl:apply-templates/></p>
</xsl:template>

<xsl:template match="bold">
	<b><xsl:apply-templates/></b>
</xsl:template>

<xsl:template match="italic">
	<i><xsl:apply-templates/></i>
</xsl:template>

Produces:

  <b>Actel</b>
  (Sunnyvale, CA) will showcase its third-generation flash-based FPGA
device, ProASIC3 (see <i>page 105</i>)-said to be the industry's
lowest-cost FPGA, starting at $1.50. The company's Libero integrated
design environment and broad IP offerings will also be on exhibit. Free
workshops and demonstrations will be offered throughout the show. (Booth
#920,
http://info.edu/47)
  </p>


cheers
andrew

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.