Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Fri, 6 Jun 2008 12:05:11 -0700 (PDT),    group: microsoft.public.xsl        back       


preserving markup   
I've got some javascript and HTML I want to enter directly into my xml
document. I've entered the JS and HTML content into a tag that's
defined as text in the schema. When I process my xml, the > and < in
the JS and HTML are output as named entitles < and >. As a
result, this content is interpreted by the browser as page content
rather than code/markup to be processed and rendered.

I've tried using just the non-escaped content as well the following
templates but the named entities always appear in the output.

  <xsl:template match="code">
      <div style="MARGIN-LEFT: 30px">
         <xsl:text disable-output-escaping="yes"><![CDATA[ </
xsl:text>
            <xsl:value-of select="."/>
	       <xsl:text disable-output-escaping="yes">]]></xsl:text>
      </div>
</xsl:template>

  <xsl:template match="code">
      <div style="MARGIN-LEFT: 30px">
          <xsl:value-of select="."  disable-output-escaping="yes"/>
      </div>
</xsl:template>

Any help would be appreciated!!

TIA,
David
date: Fri, 6 Jun 2008 12:05:11 -0700 (PDT)   author:   David Schwartz

Re: preserving markup   
"David Schwartz"  wrote in message 
news:98184477-889b-4e62-86a1-eea3d68e2f73@m36g2000hse.googlegroups.com...
> I've got some javascript and HTML I want to enter directly into my xml
> document. I've entered the JS and HTML content into a tag that's
> defined as text in the schema. When I process my xml, the > and < in
> the JS and HTML are output as named entitles < and >. As a
> result, this content is interpreted by the browser as page content
> rather than code/markup to be processed and rendered.
>
> I've tried using just the non-escaped content as well the following
> templates but the named entities always appear in the output.
>
>  <xsl:template match="code">
>      <div style="MARGIN-LEFT: 30px">
>         <xsl:text disable-output-escaping="yes"><![CDATA[ </
> xsl:text>
>            <xsl:value-of select="."/>
>        <xsl:text disable-output-escaping="yes">]]></xsl:text>
>      </div>
> </xsl:template>
>
>  <xsl:template match="code">
>      <div style="MARGIN-LEFT: 30px">
>          <xsl:value-of select="."  disable-output-escaping="yes"/>
>      </div>
> </xsl:template>
>
> Any help would be appreciated!!
>
> TIA,
> David
You have two main options, either convert the HTML to XHTML and store it 
directly or use a CDATA section and store it in that.

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
date: Sat, 7 Jun 2008 09:51:39 +0100   author:   Joe Fawcett am

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us