Jonas, that's what I want to get (and is valid).
Thanks,
...
genus
ontophaugs332
genus
ontophaugs332
genus
ontophaugs
...
2007/11/21, Jonas Geiregat <[EMAIL PROTECTED]>:
>
> I don't think it is valid to have an opening tag and a closing tag with
> nothing in between. So an initial and a final , as you recall
> it, should become .
> Second, I'm not sure I understand what you want to accomplish. From the
> example document you added is this the result you expect:
>
>
>
>
> genus
> ontophaugs332
>
>
>
>
>
>
>
> Regards
>
> Jonas
>
> On Tue, 2007-11-20 at 10:27 -0800, pere roca wrote:
> > please, I need some help with php DOM, for me it's becoming a hell!
> >
> > After trying other methods (check message from 19th november, called
> "php
> > DOM question"), I'm getting a little more success to manipulate XML.
> >
> > From the code you can see below you generate this xml. Now I just want
> to
> > keep only the initial and the final . How can I access and
> delete
> > the other (the "between" tags)?
> > I suppose there is no way to create an initial without the
> associated
> > .
> > Thanks a lot,
> >
> > Pere
> >
> > This is the WRONG XML generated from code.
> > ...
> >
> >
> >
> > genus
> > ontophaugs332
> >
> >
> >
> >
> >
> > genus
> > copris
> >
> >
> >
> >
> >
> > genus
> > copris2
> >
> >
> >
> >
> > > $species=array('ontophaugs332','copris','copris2');
> > $dom = new DOMDocument;
> > //XML we will insert the data to
> > $dom -> load('edit_iberia3.xml');
> >
> >
> > $count=count($species);
> >
> > foreach ($species as $sp=>$value) {
> > //we pass parameters of the array
> >
> > $where_to_insert= $dom->getElementsByTagName('And')->item(0);
> >
> > $child = $dom->createElement('Or');
> > $or=$where_to_insert->appendChild($child);
> >
> > $child = $dom->createElement('PropertyIsEqualTo');
> > $first=$or->appendChild($child);
> >
> > $child2 = $dom->createElement('PropertyName');
> > $first->appendChild($child2);
> >
> > $child3 = $dom->createElement('Literal');
> > $first->appendChild($child3);
> >
> > //inserting the array data
> > $values = $dom->createTextNode($value);
> > $values = $child3->appendChild($values);
> > }
> >
> > echo $dom->save(nou_iberia);
> > ?>
> > --
> > View this message in context:
> http://www.nabble.com/manipulating-XML-via-php-DOM-tf4845510.html#a13862945
> > Sent from the PHP - General mailing list archive at Nabble.com.
> >
>
>