Re: generating attributes and content for an element
Manuel Souto Pico <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
Hi Shlomi,
Thanks for your suggestion. I used XML::Simple because it was the module
used in the tutorials that I found and judging by its name I thought it
would be a good one to start learning and that I could upgrade later
when I manage to do simple things.
Thanks again, Manuel
Shlomi Fish escribió:
> On Monday 24 November 2008, Manuel Souto Pico wrote:
>
>> By the way, I forgot to mention that I'm using XML::Simple
>>
>>
>
> Yes, I figured it out. I suggest you don't use XML::Simple. I don't use it and
> have a policy against helping people who do. Try using XML::Writer or
> XML::LibXML or whatever instead. XML::Simple is philosophically bad, and when
> done half-properly, is no longer simple.
>
> Regards,
>
> Shlomi Fish
>
>
>> Cheers, Manuel
>>
>> Manuel Souto Pico escribió:
>>
>>> Hi,
>>>
>>> This is my first email to this list, so hello everyone! :)
>>>
>>> I'm starting to learn XML with Perl (and I'm not an experienced Perl
>>> programmer either), so I'd be thankful if you could be patient ;)
>>>
>>> The doubt that I have is about generating both content* and attributes
>>> for an element.
>>>
>>> (*): content which is not other elements, that is.
>>>
>>> By means of
>>> my $data = {
>>> e => ['element value'],
>>> a => 'attribute value'*
>>> *};
>>> I can get this:
>>> <root a="attribute value">
>>> <e>element value</e>
>>> </root>
>>> However, what I'm after is something like
>>> <root>
>>> <e a="attribute value">element value</e>
>>> </root>
>>> I would be very grateful for any ideas.
>>>
>>> Thank you!
>>>
>>> Manuel
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Perl-XML mailing list
>>> [email protected]
>>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>>
>
>
>
>
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs