XML::LibXML

2002-08-30 Thread Melanie Rouette

Hi,

I need to create xml DOM trees from scratch save them as xml files
so that I can reload them & make modifications to the elements'
values as well as adding new elements or attributes.  Right now I'm
using the  XML::LibXML::Document & XML::LibXML::Element classes.

 And I have a bunch of questions...

1- I would to give an XPath expression as a parameter to a method and
get as a result a pointer to the position in the DOM tree to either add
a
nee element/attribute or modify an existing one.  How do I do that?

2- Is there a way to have "C++ like friend class" in perl?

3- Do XML::LibXML::Document & XML::LibXML::Element class methods
understand Xpath expressions or do I absolutly have to use
XML::XPath::Element?

4- Is there a class that represent a DOM tree in XML::XPath package and
is there one which
would be a parser like the XML::LibXML module ...  Does it provide the
same functionalitites
XML::LibXML::Document does?

Thanks for helping out.
Melanie


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: XML module

2002-10-22 Thread Melanie Rouette
There's also XML::LibXML::Document
XML::LibXML::Node.

I currently use them and they do the job. The Document module emulates a 
DOM tree while you can use the Node module to work with your element nodes.
Mel

Admin-Stress wrote:

Hi,

anyone can suggest me XML module for reading/parsing/modifying an XML file?

Thanks,
kapot

__
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
http://webhosting.yahoo.com/

 




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




XML perl mailing list

2002-10-22 Thread Melanie Rouette
Hi,
How do I subscribe to the perl xml mailing list?
thanks


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




How do I update a single instance of a repeatable element in a xml document?

2002-11-06 Thread Melanie Rouette
Hi,
If I have something like:

   Father Brian
   Mother Elisabeth
   Sister Judy
   brother Lathan


and I want to update the  Sister Judy element only, 
based on the fact that I want to update only the element that has the 
word "Sister" in it's text content. (Let's say I want to change the name 
of my Sister so what I want as a result is Sister Elisa 
and I still want to keep all the other  elements as they are).

I use the XML::LibXML library more specifically: XML::LibXML::Document, 
XML::LibXML::Node, XML::LibXML ::Element.

How do I do that?

I tried to use the findNodes (myfamily/member) (in  XML::LibXML::Node) 
method to extract into an array the list of nodes that follow the xpath 
expression: myfamily/member.  Then I looped through my array until I 
found the element with the word Sister in it's text context.  Once 
found, I created a new node using new('Sister Elisa') 
(inXML::LibXML::Element) then I used $oldNode->replaceNode($newNode) (in 
XML::LibXML::Node).  It seems to change the value but my xml document is 
not being updated...

Melanie


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How do I update a single instance of a repeatable element in a xml document?

2002-11-06 Thread Melanie Rouette
Melanie Rouette wrote:


Hi,
If I have something like:

   Father Brian
   Mother Elisabeth
   Sister Judy
   brother Lathan


and I want to update the  Sister Judy element only, 
based on the fact that I want to update only the element that has the 
word "Sister" in it's text content. (Let's say I want to change the 
name of my Sister so what I want as a result is Sister 
Elisa and I still want to keep all the other  
elements as they are).

I use the XML::LibXML library more specifically: 
XML::LibXML::Document, XML::LibXML::Node, XML::LibXML ::Element.

How do I do that?

I tried to use the findNodes (myfamily/member) (in  XML::LibXML::Node) 
method to extract into an array the list of nodes that follow the 
xpath expression: myfamily/member.  Then I looped through my array 
until I found the element with the word Sister in it's text context.  
Once found, I created a new node using new('Sister Elisa') 
(inXML::LibXML::Element) then I used $oldNode->replaceNode($newNode) 
(in XML::LibXML::Node).  It seems to change the value but my xml 
document is not being updated...

Melanie




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: How do I update a single instance of a repeatable element in a xml document?

2002-11-08 Thread Melanie Rouette
Anybody got an idea on this?
It would be really helpful.
Melanie Rouette wrote:


Hi,
If I have something like:

   Father Brian
   Mother Elisabeth
   Sister Judy
   brother Lathan


and I want to update the  Sister Judy element only, 
based on the fact that I want to update only the element that has the 
word "Sister" in it's text content. (Let's say I want to change the 
name of my Sister so what I want as a result is Sister 
Elisa and I still want to keep all the other  
elements as they are).

I use the XML::LibXML library more specifically: 
XML::LibXML::Document, XML::LibXML::Node, XML::LibXML ::Element.

How do I do that?

I tried to use the findNodes (myfamily/member) (in  XML::LibXML::Node) 
method to extract into an array the list of nodes that follow the 
xpath expression: myfamily/member.  Then I looped through my array 
until I found the element with the word Sister in it's text context.  
Once found, I created a new node using new('Sister Elisa') 
(inXML::LibXML::Element) then I used $oldNode->replaceNode($newNode) 
(in XML::LibXML::Node).  It seems to change the value but my xml 
document is not being updated...

Melanie





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




reg ex question

2002-11-15 Thread Melanie Rouette
Hi,
I have something like: /usr/local/home/mel/file.txt and I'd like to 
strip it so that I can put the path in a variable, the file name in 
another one and the extention in a another one as well. How do I do 
that, can I do it all in a same expression.  Something like, $path = 
/usr/local/home/mel, $filename = file and finally $ext = txt.

Thanks in advance.
Melanie


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: book for perl ???

2002-11-22 Thread Melanie Rouette
That would be "Perl In a Nutshell". I also recommend it.

Jerry M. Howell II wrote:


O'Riely puts out a book most of my perl friends call the cammel book.
Probably becuse of the cammel on the front cover, that would be my
recomendation


On Fri, 22 Nov 2002 17:23:41 +0530
Sunil Sonnad <[EMAIL PROTECTED]> wrote:

 

Hi all,
 Which book would make the gr8 reference for PERL ???
  
S.





--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]