laszfellow
10-09-2006, 10:44 AM
I wish to create a non-visual text node tag.
I would use it to store sql statements or not immediately executed scripts.
e.g.
<textNode name='setCookie'>
document.cookie = 'ID=1234';
alert(document.cookie);
</textNode>
<textNode name='getAddr'>
select *
from emp
where empid = '1234'
</textNode>
To achieve that, I extended node class, simplistically shown below.
<library>
<class name='textNode' extends='node'>
<method name='getText'>
<![CDATA[
tx = text.split("&apos;").join("'");
return tx;
]]>
</method>
</class>
</library>
When run on browser, I am able to withdraw tag body by setCookie.text and getAddr.text, respectively. However, compilation shows me the message "text not allowed here". Which means Laszlo seeks to control whether I could put text between tags (why?).
Is there a class tag which I could extend and which would allow me to put text in the tag body without and compilation warnings.
Alternatively, what should I do to inform Laszlo compiler that I have a benign need to include text into the tag body? Thereby achieving my desired tag class without unnerving the Laszlo compiler's need to control whether I embed text between a pair of tags.
=============== thefreedictionary.com ================
un·nerve (n-nûrv)
tr.v. un·nerved, un·nerv·ing, un·nerves
1. To deprive of fortitude, strength, or firmness of purpose.
2. To make nervous or upset.
==================================================
I would use it to store sql statements or not immediately executed scripts.
e.g.
<textNode name='setCookie'>
document.cookie = 'ID=1234';
alert(document.cookie);
</textNode>
<textNode name='getAddr'>
select *
from emp
where empid = '1234'
</textNode>
To achieve that, I extended node class, simplistically shown below.
<library>
<class name='textNode' extends='node'>
<method name='getText'>
<![CDATA[
tx = text.split("&apos;").join("'");
return tx;
]]>
</method>
</class>
</library>
When run on browser, I am able to withdraw tag body by setCookie.text and getAddr.text, respectively. However, compilation shows me the message "text not allowed here". Which means Laszlo seeks to control whether I could put text between tags (why?).
Is there a class tag which I could extend and which would allow me to put text in the tag body without and compilation warnings.
Alternatively, what should I do to inform Laszlo compiler that I have a benign need to include text into the tag body? Thereby achieving my desired tag class without unnerving the Laszlo compiler's need to control whether I embed text between a pair of tags.
=============== thefreedictionary.com ================
un·nerve (n-nûrv)
tr.v. un·nerved, un·nerv·ing, un·nerves
1. To deprive of fortitude, strength, or firmness of purpose.
2. To make nervous or upset.
==================================================