<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
I can.<BR>I'm just curious why I can't get at it.<br><BR>I tried a couple variations on the firstChild.nodeValue thing and couldn't get that to work either.<BR><br><BR>It just seems dopey that if for instance I'm receiving a dynamic xml structure back from a server call that I can do<BR><br><BR>
<span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">sometextid.setText(interfaceData.pages[0].page[0].id); // an attribute </span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br></span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">or<br></span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br></span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">remove the CDATA tags and have setText work correctly.<br></span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br></span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">but if I encounter CDATA tags in the data I'm forced to recast type?</span><BR><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br></span><BR><br><BR>  <BR><br><BR><div><hr id="stopSpelling">From: Julian.Tenney@nottingham.ac.uk<br>To: xerte@lists.nottingham.ac.uk<br>Date: Mon, 15 Aug 2011 12:20:53 +0100<br>Subject: [Xerte] Re: address CDATA?<br><br>

<style>
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxecxmsonormal, .ExternalClass li.ecxecxmsonormal, .ExternalClass div.ecxecxmsonormal
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass p.ecxecxmsochpdefault, .ExternalClass li.ecxecxmsochpdefault, .ExternalClass div.ecxecxmsochpdefault
{margin-right:0cm;margin-left:0cm;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink
{;}
.ExternalClass span.ecxecxmsohyperlinkfollowed
{;}
.ExternalClass span.ecxecxemailstyle21
{;}
.ExternalClass p.ecxecxmsonormal1, .ExternalClass li.ecxecxmsonormal1, .ExternalClass div.ecxecxmsonormal1
{margin-right:0cm;margin-bottom:0cm;margin-left:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxmsohyperlink1
{color:blue;text-decoration:underline;}
.ExternalClass span.ecxecxmsohyperlinkfollowed1
{color:purple;text-decoration:underline;}
.ExternalClass span.ecxecxemailstyle211
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass p.ecxecxmsochpdefault1, .ExternalClass li.ecxecxmsochpdefault1, .ExternalClass div.ecxecxmsochpdefault1
{margin-right:0cm;margin-left:0cm;font-size:10.0pt;font-family:'Times New Roman','serif';}
.ExternalClass span.ecxecxm
{;}
.ExternalClass span.ecxecxt
{;}
.ExternalClass span.ecxb
{;}
.ExternalClass span.ecxEmailStyle31
{font-family:'Calibri','sans-serif';color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}

</style><div class="ecxWordSection1"><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">Not sure. From the xml directly it’s via firstChild (it see the CDATA as a child node), but xmlToObject obviously drops the object itself into the array.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">But this isn’t the problem: if it were reporting ‘object’ then you’d see ‘object’ on the screen, not undefined.</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">Why can’t you re-cast it?</span></p><p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="ecxMsoNormal" style="margin-left:36.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Dave Burnett<br><b>Sent:</b> 15 August 2011 12:03<br><b>To:</b> Xerte list<br><b>Subject:</b> [Xerte] Re: address CDATA?</span></p></div></div><p class="ecxMsoNormal" style="margin-left:36.0pt"> </p><div><p class="ecxMsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:36.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br><br>:-) Yes I know I can recast it.<br><br><br>But how do I get directly to the string within the CDATA tags?<br><br><br>debug( interfaceData.pages[0].page[0].intro_text[0]) // shows "blah" in the debug window <br>debug(typeof interfaceData.pages[0].page[0].intro_text[0]) // reports "object" <br><br><br><br><br>sometextid.setText(interfaceData.pages[0].page[0].intro_text[0]); <br><br><br>Says undefined on screen  (because it's reporting as an object?)<br><br><br><br><br><br><br><br><br><br><br><br><br>From: Julian.Tenney@nottingham.ac.uk<br><br>To: xerte@lists.nottingham.ac.uk<br>Date: Mon, 15 Aug 2011 11:32:50 +0100<br>Subject: [Xerte] Re: address CDATA?</span></p><div><p class="ecxMsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D">String(your[0].expression[0].here);</span></p><p class="ecxMsoNormal" style="margin-left:36.0pt"><span style="font-size:11.0pt;font-family:'Calibri','sans-serif';color:#1F497D"> </span></p><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="ecxMsoNormal" style="margin-left:72.0pt"><b><span lang="EN-US" style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] <b>On Behalf Of </b>Dave Burnett<br><b>Sent:</b> 12 August 2011 15:50<br><b>To:</b> Xerte list<br><b>Subject:</b> [Xerte] address CDATA?</span></p></div></div><p class="ecxMsoNormal" style="margin-left:72.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></p><div><p class="ecxMsoNormal" style="margin-left:72.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br><br>Senior moment.<br><br><br>What's the syntax for addressing the CDATA content so it comes out as typeof = string?<br><br><br><br><br><span class="ecxm"><</span><span class="ecxt">content</span><span class="ecxm">></span></span></p><div><div><div><div style="margin-left:12.0pt"><p class="ecxMsoNormal" style="margin-left:72.0pt;text-indent:-24.0pt"><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><</span></span><span class="ecxt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">pages</span></span><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">></span></span></p></div><div><div><div style="margin-left:12.0pt"><p class="ecxMsoNormal" style="margin-left:72.0pt;text-indent:-24.0pt"><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">   <</span></span><span class="ecxt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">page id</span></span><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">="</span></span><b><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">1</span></b><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">"></span></span></p></div><div style="margin-left:12.0pt"><p class="ecxMsoNormal" style="margin-left:72.0pt;text-indent:-24.0pt"><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">      <</span></span><span class="ecxt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">intro_text</span></span><span class="ecxm"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">></span></span></p></div><div><div><div><div><p class="ecxMsoNormal" style="margin-left:72.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'">- <span class="ecxm">                <![CDATA[blah]]></span> </span></p></div><div><p class="ecxMsoNormal" style="margin-left:72.0pt"><span class="b"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> </span></span><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"> <span class="ecxm">        </</span><span class="ecxt">intro_text</span><span class="ecxm">></span></span></p></div></div></div></div></div></div></div></div></div><p class="ecxMsoNormal" style="margin-right:0cm;margin-bottom:12.0pt;margin-left:72.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br><br><br><br><br> <br>interfaceData = ifc.templateData.content[0];<br><br><br>debug(typeof interfaceData.pages[0].page[0].intro_text[0]);<br>//gives me "object"<br><br><br>How do I get at the string directly?<br>I know I could put it in a variable and re-type it, but I want to set text directly:<br><br><br>sometextid.setText(interfaceData.pages[0].page[0].intro_text[0]);<br>//displays undefined - because it's an object<br><br><br><br><br><br><br><br><br><br><br><br></span></p></div></div><p class="ecxMsoNormal" style="margin-left:36.0pt"><span style="font-size:10.0pt;font-family:'Tahoma','sans-serif'"><br>This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. <br>This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. <br><br>_______________________________________________ Xerte mailing list Xerte@lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. </span></p></div></div><br>_______________________________________________
Xerte mailing list
Xerte@lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it.   Please do not use, copy or disclose the information contained in this message or in any attachment.  Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.</div>                                     </div></body>
</html>