Re: generating attributes and content for an element

Shlomi Fish <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
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



-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Understand what Open Source is - http://xrl.us/bjn82

Shlomi, so what are you working on? Working on a new wiki about unit testing 
fortunes in freecell? -- Ran Eilam
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.