mt1,
I don't think this is a Laszlo code issue. You may need to use the numeric reference , here is a list.

Ampersand       &   &       &
Left angle bracket      &lt;    <       &#38;#60;
Right angle bracket     &gt;    >       &#62;
Straight quotation mark         &quot;  "       &#39;
Apostrophe      &apos;  '       &#34;


Try this code out if you want to display "<ABCD>" to the user, FYI I'm running 3.3.3 .

<canvas debug="true">
<dataset name="ds">
<data>&#38;#60;ABCD&#62;</data>
</dataset>

<handler name="oninit">
var dp = new LzDatapointer();
dp.setPointer(ds);

Debug.write( "dp serialize : " + dp.serialize() );
Debug.write( "dp xpathQuery: " + dp.xpathQuery("data/text()") );

var text = dp.xpathQuery('data/text()');
testText.setAttribute('text', text);

</handler>

<view bgcolor="blue" width="100" height="100">
       <text id="testText" resize="true" text="Hello"/>
</view>
</canvas>

Just my 2 cents.
-Daniel

mt1 wrote:
Any hints?

mt1 wrote:
Yes i thought so, but there were not it in xpathQuery() method or *.as files.
So i confused where it has been done.
You can see that where is ?

Thanks
mt1

Not Zippy wrote:
I believe the data is being unescaped.
Debug.write(unescape("&lt;ABCD&gt;")  )


On 3/5/07, *mt1* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi forks,

    I am wondering how to handle a escape characters in
    LzDatapointer.xpathQuery().
    This is a example code.

    <canvas debug="true">
    <dataset name="ds">
    <data>&lt;ABCD&gt;</data>
    </dataset>

    <handler name="oninit">
    var dp = new LzDatapointer();
    dp.setPointer(ds);

    Debug.write( "dp serialize : " + dp.serialize() );
    Debug.write( "dp xpathQuery: " + dp.xpathQuery("data/text()") );
    </handler>
    </canvas>

    You can see the data with escaped in <dataset> tag.
    And the first debug line ( using serialize() ) shows the strings
    without
    modification,
    but the second debug line ( using xpathQuery() ) shows "<ABCD>"
    out of
    the way by
    operating unescaped.
    I took a look around LzDatapointer.as or LzDataElement.as, but
    xpathQuery() do not
    translate from '&gt' to '<' anywhere.

    Please let me know why xpathQuery() can do such like that ?

    mt1





Reply via email to