开发者

Perl XML::Simple XMLout function

开发者 https://www.devze.com 2022-12-22 19:33 出处:网络
I pass in the following XML to XMLin: <root foo=\"bar\" foo2=\"bar2\"> <pizzas> <pizza>Pepperoni</pizza>

I pass in the following XML to XMLin:

<root foo="bar" foo2="bar2">
<pizzas>
<pizza>Pepperoni</pizza>
</pizzas>
</root>

I then edit part o开发者_如何学编程f the root element via hash array. I don't care about the pizza, but I do need that XML to come back out exactly as it was. However, I get the following from XMLout:

<root foo="bar" foo2="bar2">
<pizzas pizza="Pepperoni"</pizzas>
</root>

Thoughts?


My guess is that you did not use ForceArray with XMLin. Give that a try. If that does not work, show us your Perl code.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号