[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: "Michael Kay" <mike@s...>
  • To: "'Mukul Gandhi'" <gandhi.mukul@g...>
  • Date: Sun, 25 Nov 2007 14:59:20 -0000

RE:  Including unparsed xml (xhtml code) code in xslt output.
Yes, sorry, I was jumping a step. I should have said that instead of doing

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

and then <xsl:copy-of select="node-set($rtf)/nodexhtml/*"/>, you could do

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

and then <xsl:copy-of select="$rtf"/>

Michael Kay
http://www.saxonica.com/


> -----Original Message-----
> From: Mukul Gandhi [mailto:gandhi.mukul@g...] 
> Sent: 25 November 2007 14:00
> To: Michael Kay
> Cc: http://www.pas-world.com; xml-dev@l...
> Subject: Re:  Including unparsed xml (xhtml code) 
> code in xslt output.
> 
> Hi Mike,
>    I agreed to your point in hurry :) After that, I double 
> checked by running the following stylesheet:
> 
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                         version="1.0">
> 
> <xsl:output indent="yes" />
> 
> <xsl:template match="/">
>   <xsl:copy-of select="$rtf/nodexhtml/*" /> </xsl:template>
> 
> <xsl:variable name="rtf">
>   <nodexhtml>
>    <html><h1>Hello</h1></html>
>   </nodexhtml>
> </xsl:variable>
> 
> </xsl:stylesheet>
> 
> with two XSLT 1.0 processors (Xalan-J and MSXSL 4.0), and 
> following are the results (the transformation fails):
> 
> Xalan-J 2.7.0
> ------------------
> XSLT Error (javax.xml.transform.TransformerException):
> org.apache.xpath.objects.XRTreeFrag cannot be ca st to 
> org.apache.xpath.objects.XNodeSet Exception in thread "main" 
> java.lang.RuntimeException: org.apache.xpath.objects.
> XRTreeFrag cannot be cast to org.apache.xpath.objects.XNodeSet
> 
> MSXSL 4.0
> ----------------
> Reference to variable or parameter 'rtf' must evaluate to a node list.
> 
> It therefore seems that my original reply was right ...
> 
> Would you agree?
> 
> On 11/25/07, Mukul Gandhi <gandhi.mukul@g...> wrote:
> > On 11/25/07, Michael Kay <mike@s...> wrote:
> > > Actually that works in 1.0 as well. XSLT 1.0 allows two 
> operations 
> > > on a result tree fragment: copying, and conversion to a string.
> >
> > Thanks Mike for clarifying this to me.
> 
> 
> --
> 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.