Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-30-2008, 07:14 AM   #1 (permalink)
Kayers
Recruit
 
Join Date: Sep 2008
Posts: 5
Kayers is on a distinguished road
Tag over-lapping in XSL?

I made some tags for bold, italics, and so on in XML using XSL, except I can't get them to over-lap like HTML will do. For example:

Quote:
This is <bold>special</bold> text
...shows up as...

Quote:
This is special text
...but the following example...

Quote:
This is <ital>very <bold>special</bold></ital> text
...shows up as...

Quote:
This is very special text
...instead of the hoped:

Quote:
This is very special text
Any ideas? Anything would be useful, even a recomendation to another forum would help.

Thanks,
- Keith

(Here's my code)

Quote:
<xsl:template match="content/page/paragraph">
<xsl:choose>
<xsl:when test="@type = 'textonly'">
<xsl:if test="@title != ''">
<p class="content_body_right_subtitle"><xsl:value-of select="@title"/></p>
</xsl:if>
<p class="content_body_right_text"><xsl:apply-templates/></p>
</xsl:when>
<xsl:when test="@type = 'list'">
<xsl:if test="@image != ''">
<img src="{@image}" alt="" style="margin-right:15px; margin-bottom:15px; float:right;" />
</xsl:if>
<xsl:apply-templates select="list"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="@title != ''">
<p class="content_body_right_subtitle"><xsl:value-of select="@title"/></p>
</xsl:if>
<p class="content_body_right_text"><img src="{@image}" alt="" style="margin-left:15px; margin-bottom:15px; float:right;" /><xsl:value-of select="."/></p>
</xsl:otherwise>
</xsl:choose>
</xsl:template>


<xsl:template match="content/page/paragraph/bold">
<strong><xsl:apply-templates/></strong><xsl:text> </xsl:text>
</xsl:template>

<xsl:template match="content/page/paragraph/ital">
<i><xsl:apply-templates/></i><xsl:text> </xsl:text>
</xsl:template>
Kayers is offline   Reply With Quote
Old 10-02-2008, 05:30 AM   #2 (permalink)
Kayers
Recruit
 
Join Date: Sep 2008
Posts: 5
Kayers is on a distinguished road
Nevermind another forum post helped me (I just needed to take out the path of the bold and ital templates)

One last thing: Does anyone know how to make the <hr> in XML?
Kayers is offline   Reply With Quote
Reply

Bookmarks

Tags
overlap, tags, xml, xsl, xslt

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
bold, italics, and underlined in xml, dtd, and xsl Kayers HTML, XML, Javascript, AJAX 2 09-30-2008 07:01 AM
CSS changing default text in BODY tag DavH27 HTML, XML, Javascript, AJAX 3 11-02-2006 09:57 AM
How to get element or attribute or tag from a WSDL. Rice Cai Java 0 02-27-2006 12:56 AM
Help with creating surrounding tag nefiga HTML, XML, Javascript, AJAX 0 05-16-2005 03:57 PM


All times are GMT -8. The time now is 01:36 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting