Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: XML::LibXML- Escape Empty Tags

by ramrod (Chaplain)
on Jul 30, 2009 at 14:35 UTC ( #784627=note: print w/ replies, xml ) Need Help??


in reply to XML::LibXML- Escape Empty Tags

What all have you tried? I would start with

$node->textContent;
or
$tree->findnodes("//imageURL_med/text()");


Comment on Re: XML::LibXML- Escape Empty Tags
Select or Download Code
Re^2: XML::LibXML- Escape Empty Tags
by Anonymous Monk on Jul 30, 2009 at 15:21 UTC
    I have no idea as to where i need to implement this line, can you just develop or explain a bit more this path, i would try it if at least i knew where to try :) Sorry i am completly lost.
      So I guess you didn't try anything?
      It seemed from the code you posted that you were somewhat familiar with XML::LibXML.
      Anyway, if you want to access text try (in your loop):
      $child->textContent;
      Or if you want to get the text node try (anywhere after you parse the file):
      $tree->findnodes("//imageURL_med/text()");
        I ve just discovered the module yesterday and tried to actually output something :D, after reading quite few things i tried the hasChild function to check if there is data in those tag but couldn't make it work,. So i ve tried but my knowledge and skills are very limited. Thanks for the tip though
Re^2: XML::LibXML- Escape Empty Tags
by ikegami (Pope) on Jul 30, 2009 at 16:21 UTC
    I don't think the second will work, because I don't think there's a text node to match.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://784627]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-05 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls