SunQuest
           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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old June 12th, 2003, 01:36 PM
fistandantilus fistandantilus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 fistandantilus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Embedding HTML tags in XML

Hi there everyone. I am new to XML, and creating a web app for an academic project using Javascript and XML. A part of the project is to have HTML captioning with Quicktime video. An editor is to generate the XML data, and then Javascript handles the rest.

I am reading in an external XML file on the page load, and then turning the data into Javascript objects. One of the elements that I am reading is for a transcript, which may be displayed anywhere on the HTML page, and may contain HTML tags.

For example I can have multiple transcripts.

Code:
<transcript><![CDATA[This is some <b>bold</b> text.]]></transcript>
<transcript>...</transcript>
...


Then with Javascript I read in the text for the transcript elements into an array.

When i display the text somewhere.

Code:
document.getElementById('Caption').innerText = transcriptArray[tempCounter];


I get the whole text string, unrendered in HTML.
"This is some <b>bold</b> text"

I tried playing with an XSL template and creating an HTML namespace with no luck, but I don't think that is a solution since i am reading the XML into Javascript first, and then displaying the data in a regular HTML page.

If anyone has any suggestions or can point a finger in the right direction, it would be greatly appreciated.

Thanks

Last edited by fistandantilus : June 12th, 2003 at 05:03 PM.

Reply With Quote
  #2  
Old June 13th, 2003, 06:58 AM
fistandantilus fistandantilus is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 2 fistandantilus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
stupid me

Ok, sorry.. THis question was more of a javascript question than XML.

I made a glaring mistake, which is that i used innerText rather than innerHTML.

CDATA works fine

thanks for reading

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Embedding HTML tags in XML


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 3 hosted by Hostway