Thomas, Mark - BLS CTR schrieb:
> Birgit Kellner wrote:
>
>> <seg>This is a segment of text. It goes on
and on. <note><span
>> type="lemma">Here</span>
>> <app>
>> <lem>Here</lem>
>> <rdg
wit="Ms-A">Here</rdg>
>> <rdg
wit="Ms-B">There</rdg>
>> </app>
>> </note>
>> there is a note, but after the note the text
continues.</seg>
>>
>> How can I get whatever code I wish to create for
the note to be
>> inserted
>> *exactly* at the start of the <note>-Element,
>>
>
> Each text segment is a different node. In other words,
<seg> has three
> children:
> 1. A text node containing "This is a segment... on
and on. "
> 2. A <note> element
> 3. A text node containing "there is a note...
continues."
>
> So doing what you want to do is not a problem.
>
> - Mark.
>
>
>
That's good to know. Do you have any suggestions how exactly
I might go
about it, then?
I tried this with XML::LibXML:
my $children = $seg->findnodes('child: ');
foreach my $child ($children->get_nodelist) {
print $child->textContent ;
my $name = $child->nodeName;
print "$name n";
}
While the code correctly returns the <note>-Element,
it doesn't return
the text node; actually it returns the text content of
<seg>; instead,
it returns the text content of all <rdg>-elements.
Thanks,
Birgit
_______________________________________________
Perl-XML mailing list
Perl-XML listserv.ActiveState.com
To unsubscribe: http:/
/listserv.ActiveState.com/mailman/mysubs
|