This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: XSLT/XML and HTML Tags in the XML Data


| I am using Oracle's Parser for XML/XSLT to display search results.  We have
| some fields in our database that has HTML tags in the data to emphasize the
| text in the browser.  A good example of this is to have parts of data being
| bold using <STRONG> tag, or displaying information using bullets with <UL>
| tags.  I create XML using this data, and when I send the XML to the XSLT
| processor, I don't get any results back if there are any HTML tags in the
| data.

Would need to see your templates that are selecting the data to format
to help explain this symptom.

| Is there any way I can have the XSLT processor to ignore the HTML Tags?

The typical FAQ in this area is that if you are generating
query results that contain HTML fragments like:

<ROWSET>
  <ROW>
    <SKU>12345</SKU>
    <DESC>Big Red Apple</DESC>
    <BLURB>
      &lt;ul>
        &lt;li>&lt;b>Delicious&lt;/b>&lt;/li>
        &lt;li>&lt;b>Nutritious&lt;/b>&lt;/li>
      &lt;/ul>
    </BLURB>
  </ROW>
</ROWSET>

And you want the HTML "blurb" to showup "verbatim"
in the output:

for this you'd use (assuming the current node is "ROWSET/ROW"):

   <xsl:value-of disable-output-escaping="yes"
                           select="BLURB"/>

This will produce:

 <ul>
   <li><b>Delicious</b></li>
   <li><b>Nutritious</b></li>
 </ul>


______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]