2013-07-10 3 views
-1

Я работаю на питание и ва пытается разобрать следующий тег:извлечения данных из кодированного тега в XML

<content:encoded> 
<![CDATA[ 
<p><strong><a href="http://www.highlandradio.com/wp-content/uploads/2013/07/sf.jpg"><img class="aligncenter size-full wp-image-54126" alt="sf" src="http://www.highlandradio.com/wp-content/uploads/2013/07/sf.jpg" width="210" height="240" /></a>A SF Cllr in Strabane has denied allegations that they assaulted a member of the SDLP party.</strong></p> <p>On Sunday the PSNI confirmed they were investigating an incident after they received a report of an assault in the early hours of Saturday morning.</p> <p>The Sinn Fein Cllr, who cannot be named for legal reasons, said that they totally deny the allegations that have been reported to the PSNI by the SDLP.</p> <p>The Cllr also said that they are seeking legal advice in relation to what they called &#8220;highly prejudicial&#8221; comments made by SDLP members on social media websites and to the local media.</p> <p>Sinn Fein says the allegations made have been presented as fact by the SDLP, which has attempted to subvert the Cllrs right to due legal process.</p> <p>And the statement concludes that the comments made by some SDLP members are unsubstaniated, and, as of yet un-investigated.</p> <p>Earlier this week the SDLP claimed that a representative in Strabane had been assaulted by a Sinn Fein Cllr over the weekend.</p> <p>&nbsp;</p> 
]]> 
</content:encoded> 

У меня есть только базовые немного знаний по предмету и пытается:

for (var i=0;i<items.length;i++) { 
     data.push({ 
      title: items.item(i).getElementsByTagName("title").item(0).text, 
      content: item(i).getElementsByTagName("content: encoded").item(0).text, 
      className: "TableRow", 
      hasChild: true, 
      js:"external.js", 

     }); 

Это тег содержимого, который выдает ошибку. Может ли кто-нибудь помочь мне в том, как это расшифровать? Я работаю с титаном, но в основном это просто javascript. Мне нужно изображение и описание

+4

Этот вопрос не по теме, потому что они позволят нам только закрыть опечатки/связанные с синтаксисом вопросы как таковые – random

ответ

1

есть место в («content: encoded»), поэтому удалите его и повторите попытку.

+0

Это сработало спасибо! – user2363025

+0

, если вы нашли это сообщение, тогда вы сможете пометить его как принятый. –

+0

сделано. Если вы свободны, вы можете помочь с этим: http: //stackoverflow.com/questions/17616087/regular-expression-search-with-xml – user2363025

Смежные вопросы