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

Re: Including unparsed xml (xhtml code) code in xslt output.

  • From: "Mukul Gandhi" <gandhi.mukul@g...>
  • To: "http://www.pas-world.com" <dev001@p...>
  • Date: Sun, 25 Nov 2007 10:47:48 +0530

Re:  Including unparsed xml (xhtml code) code in xslt output.
There are some basic flaws in your logic.

The XML fragment:

<nodexhtml>
<html><h1>Hello</h1></html>
</nodexhtml>

cannot appear at this place in the stylesheet. This violates the XSLT
(1.0 & 2.0) syntax.

Alternate is to wrap this fragment in a variable (as follows):

<xsl:variable name="rtf">
<nodexhtml>
   <html><h1>Hello</h1></html>
</nodexhtml>
</xsl:variable>

Then you can output this fragment from elsewhere in the stylesheet as:

1)
<xsl:copy-of select="$rtf/nodexhtml/*" /> (in XSLT 2.0)

or as:

2)
<xsl:copy-of select="xx:node-set($rtf)/nodexhtml/*" /> (in XSLT 1.0)

In both cases 1) and 2), the XML fragment is parsed.

PS: There is a list, http://www.mulberrytech.com/xsl/xsl-list
dedicated to XSLT topics.

On 11/24/07, http://www.pas-world.com <dev001@p...> wrote:
> Hello,
> How I can output from XSLT unparsed xml?
>
>
> <xsl:stylesheet>
> <xsl:template match="">
>
> <xsl:value>
> <!-- Here I need the unparsed code -->
> <xsl:value-of select="nodetexhtml">
> </xsl:template>
>
> <nodexhtml>
> <html><h1>Hello</h1></html>
> </nodexhtml>
>
> </xsl:stylesheet>
>
>
> Output of apply XSLT should be the unparsed content of nodexhtml, should
> be unparsed xhtml:
>
> <html><h1>Hello</h1></html>
>
>
> I'm trying with Xinclude but do not work. Any suggestion is welcome.
> Thanks in advance.


-- 
Regards,
Mukul Gandhi


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.