cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: [WOODY] - How to bind a repeater from other widget (or add filled in repeaters from another source )
Date Fri, 02 Apr 2004 01:41:38 GMT
On 01.04.2004 20:31, JD Daniels wrote:

>>> This is a sample of what is being loaded into document:
>>> <InventoryItem>
>>>    <id>4</id>
>>>    <inventoryId>11033</inventoryId>
>>>    <inventoryType>2</inventoryType>
>>>   <description>100BBL Skidded pop tank, c/w tone tone paint, 
>>> thie</description>
>>>   <initialRate/>
>>>   <monthRate>300.00</monthRate>
>>>   <dayRate>15.00</dayRate>
>>> </InventoryItem>
>>>
>>> document.getFirstChild().getLastChild().nodeValue = ""
>>> document.getFirstChild().nodeName = InventoryItem
>>> document.getFirstChild().nodeName = InventoryItem
>>
>>
>>
>> Should be something like this:
>>
>> var rootNode = document.getFirstChild();
>> var child = rootNode.getFirstChild();
>>
>> do {
>>     if (child.getNodeName().equals("description")) {
>>         break;
>>     }
>>     child = child.getNextSibling();
>> } while (child);
>>
>> var value = child.getNodeValue();


> I added:
>    do {
> print(child.getNodeName());
> print(child.getNodeValue());

> description
> null

This means it iterates til it finds description. But the nodeValue seems 
to be wrong. I guess you must go on step down at the end:
var value = child.getFirstChild().getNodeValue();

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message