Re: generating attributes and content for an element
Michael Ludwig <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
Manuel Souto Pico schrieb:
> Michael Ludwig escribió:
>> Manuel Souto Pico schrieb:
>>>
>>> my $data = {
>>> e => ['element value'],
>>> a => 'attribute value'*
>>> *};
>>
>> This is a syntax error, and incomplete. You're using XML::Simple,
>> which may become very complicated if what you want to do isn't simple
>> enough.
>>
> I'm sorry, what is the syntax error exactly? If you are referring to
> the absent comma, I though it wasn't needed after the last element
> before the block-closing bracket.
It isn't, you're correct. I was referring to the asterisks ** :-)
> Could you believe that I had already tried this? :) Using the word
> 'content' was my first guess, but it didn't work. I probably had the
> brackets wrong or something. But it does work now!
I believe you, no question - I started out myself getting the brackets
wrong. Well, that's XML::Simple for you. As Shlomi has pointed out, it's
a kludgy way of dealing with XML.
> By the way, in case you are interested, what I'm doing is converting a
> dictionary that I have in XML to Martif format. With XMLin I captured
> the original dictionary and now I'm trying to transfer the contents to
> the new structure.
I don't know Martif, but it sounds like you should be using a high-level
language instead. Consider using XSLT - it'll pay off.
Michael Ludwig
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs