Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在查看的一些 Perl 代码正在从方法调用返回 xml 数据。如何查看此 xml 数据?
代码:
print "$xml";
我得到什么:
XML::XPath=HASH(0xa408dbc)
我想要什么: 实际的xml内容,即:
<sometag> <sometag2/> </sometag>
我相信你想要一个
print $xml->find('/')->string_value; print $xml->findnodes_as_string('/');
也就是说,找到/XPath 对象的根 (' ') 节点,并将其作为字符串打印出来。
/