Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Transforming HTML tags

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 5/3/2004 1:26:00 PM

msnews.microsoft.com wrote:

> I have an XML data with HTML tags. When I transform this file, the resultant
> HTML displays the html tags not the formatting intended by these tags.
> I am sure this is very easy but I don't know how to solve this problem.
> Here is the XML file;
> 
> <?xml version="1.0" encoding="windows-1252"?>
> <?xml-stylesheet type='text/xsl' href='lr_detail.xsl'?>
> <bestand id="96341" ugl_nr="96">
>  <datum>19.11.1974</datum>
>  <ordnungsziffer>1</ordnungsziffer>
>  <ueberschrift>Verordnung über Zuständigkeiten nach dem Gesetz zum Schutz
> gegen Fluglärm</ueberschrift>
>  <details bes_id="96341">
>   <detail id="1986796">
>    <typ/>
>    <bezeichnung>0</bezeichnung>
>    <ueberschrift/>
>    <text>&lt;p class=lrueberschrift&gt;Verordnung&lt;BR&gt;
> über Zuständigkeiten nach dem &lt;BR&gt;
> Gesetz zum Schutz gegen Fluglärm&lt;/P&gt;
> &lt;/B&gt;&lt;P&gt; &lt;/P&gt;
> &lt;B&gt;&lt;P ALIGN="CENTER"&gt;Vom 19. November 1974&lt;/B&gt;(Fn &lt;A
> HREF="#FN1"&gt;1&lt;/A&gt;)&lt;/P&gt;
> &lt;P&gt; &lt;/P&gt;
> &lt;P&gt; &lt;/P&gt;
> &lt;P&gt;Auf Grund des § 5 Abs. 1 des Ersten Vereinfachungsgesetzes vom 23.
> Juli 1957 (GV. NW. S. 189)(Fn &lt;A HREF="#FN2"&gt;2&lt;/A&gt;), zuletzt
> geändert durch Gesetz vom 18. Mai 1971 (GV. NW. S. 146), wird nach Anhörung
> des Ausschusses für Wohnungs- und Städtebau des Landtags
> verordnet:&lt;/P&gt;
> &lt;P&gt; &lt;/P&gt;
> &lt;P&gt; &lt;/P&gt;
> 
> </text>
>   </detail>
>  </details>
> </bestand>
> 
> And this XSL code is supposed to display "text" element's value;
> <tr><td colspan="2"><xsl:value-of
> select="bestand/details/detail/text"/></td></tr>

You could try
   <xsl:value-of select="bestand/details/detail/text"
                 disable-output-escaping="true" />
that should work with IE/MSXML but be warned that not every XSLT engine 
supports that, for instance with Mozilla it is not supported.

A better approach is the embed the HTML not escaped but as XHTML markup 
in your XML, that way you can process it with templates

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent