XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old November 23rd, 2002, 04:44 PM
azaitchik azaitchik is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Posts: 6 azaitchik User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dealing with text and internal tags

I have a document with "<para>" elements containing text that need some massaging and are output as javascript variable values like so:
<xsl:template match="para">
someArray[someArray.length]='<xsl:value-of select="normalize-space(translate('.','a','A'))" />';
</xsl:template>
(The javascript doesn't concern us here; neither do the details on the translation or the whitespace handling.)
Trouble is, the <para> sometimes contains markup like the html list tags (OL, UL, LI), and I need the text (assigned to the javascript variable) to keep these tags inside the text string itself. For example, the input document might have
<para>
This is some para text
<ul>
<li> this is the first list element </li>
<li> this is the second list element</li>
</ul>
This is some other paragraph text
</para>
Since I also need to apply the "massaging" of the para text I am confused how to do this.
If someone can tell me how to construct the relevant templates I would be very very grateful. It seems that I need templates for <ol> and <ul> and <li> but I am not sure how to (a) copy those nodes, (b) get the resulting TOTAL text for the <para> nodes that contain them, and (c) assign the result to the javascruipt variable.
Help!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Dealing with text and internal tags


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway