Hi ,
I am trying change some content in a DCR, using XML:

OM . hasChildNodes returns me true , however it is not able to modify the "Seller" Item value. Any easier way please , thanks a lot.
DCR: /tmp/auction.
________________
TEST
TEST
2007-09-02
Lansing
JNM
fred@helloworld.com
2007
R
09
~
OUTPUT.
______
MODIFIED DCR : /tmp/auction
Item now: Item
Item value now:
DCR Item now: Item comparing with element Seller
Item now: Description
Item value now:
DCR Item now: Description comparing with element Seller
Item now: Start Date
Item value now:
DCR Item now: Start Date comparing with element Seller
Item now: Seller Location
Item value now:
DCR Item now: Seller Location comparing with element Seller
Item now: Seller
Item value now:
DCR Item now: Seller comparing with element Seller
GOT matching element
DCR HAS Child Nodes: 1
MODIFIED DCR : 0
PERL routine:
___________
sub change_dcr_attr {
my ($dcr,$element_name,$element_value) =
@_;
my $parser=new XML:

OM:

arser;
#parse the document
my $dcr_doc=$parser->parsefile($dcr)|| die "unable to parse document: $!";
#get all tags
my $dcr_items = $dcr_doc->getElementsByTagName('item');
# iterate over all tags
for my $i (0..$dcr_items->getLength-1) {
my $dcr_item=$dcr_items->item($i);
# get the value of the ?name? attrribute
my $dcr_item_name = $dcr_item->getAttribute("name");
print "Item now: $dcr_item_name\n";
print "Item value now: $dcr_item_values\n";
#process only required field
#e.g.?Surname?
print "DCR Item now: $dcr_item_name comparing with element $element_name\n";
next unless $dcr_item_name eq $element_name;
# drill down to the tag
print "GOT matching element\n";
my $dcr_next = $dcr_item->getNextSibling ;
print "DCR HAS Child Nodes: $dcr_haschilds\n";
# get down to the text we want to change
print "Child: $dcr_next->getData()\n";
my $dcr_text_node = $dcr_item_child->getFirstChild if defined $dcr_item_child;
if (defined ($dcr_text_node)) {
if (( $dcr_text_node->getNodeType == TEXT_NODE) ) {
# finally change the value
print "Setting Element Value : $element_value\n";
$dcr_text_node->setData($element_value);
}
}
else {
return 0;
}
}