Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML + XSL ----> HTML 3

Status
Not open for further replies.

rcodarini

Programmer
Jul 3, 2001
8
IT
Hi!

I'have a small problem with an XSL file, I'have an xml file that describes a tab strip control, I want with an xsl file transform the xml file into an html file.

My problem is that the html generated file isn't viewed as an HTML file but as a text file, if I copy the result of the xsl file into notepad and I substitute the &.lt; with the < character and the &.gt; with the > character and I save all as an HTML file, internet explorer shows me the right html file.

thanks
Roberto
 
hmmm. I'm not exactly sure what you are asking, however I recently learned about the xsl:text tag. Take a look

**************rendered using html with xsl this xsl escaping is disabled in html**********************
<xsl:text disable-output-escaping=&quot;yes&quot;>
&lt;/tr&gt; &lt;tr&gt; &lt;td class=&quot;navItem&quot; &gt;
</xsl:text>


hope this helps.
Liz
 
I specify the problem....

<xsl:for-each select=&quot;Element&quot;>
<A href='<xsl:value-of select=&quot;Url&quot;/>'><xsl:value-of select=&quot;Description&quot;></A>
</xsl:for-each>

I want to insert an URL into the <A> tag of HTML

Thanks to Liz for the help

ROb

 
Hello,

The XSL code for that is:
<xsl:for-each select=&quot;Element&quot;>
<A>
<xsl:attribute name=&quot;href&quot;><xsl:value-of select=&quot;Url&quot;/>
</xsl:attribute>
<xsl:value-of select=&quot;Description&quot;>
</A>
</xsl:for-each>

or if you prefer longer way:

<xsl:for-each select=&quot;Element&quot;>
<xsl:element name=&quot;A&quot;>
<xsl:attribute name=&quot;href&quot;><xsl:value-of select=&quot;Url&quot;/>
</xsl:attribute>
<xsl:value-of select=&quot;Description&quot;>
</xsl:element>
</xsl:for-each>

Take a look at XSL tutorial:
Hope this helps.
D.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top