Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: A data structure for XML generation

by moritz (Cardinal)
on Aug 17, 2009 at 06:50 UTC ( [id://789091]=note: print w/replies, xml ) Need Help??


in reply to A data structure for XML generation

Over the weekend I used Carl Mäsak's SVG module (Perl 6), which -- despite its name -- is general XML serializer.

It uses Pair objects for both attributes and child tags, distinguished by the type of the value: if the value is an List, it's used as a child tag, if it's a scalar it's used as an attribute.

The documentation uses this example:

my $svg = :svg[ # root tag :width(200), # attribute :height(200), # circle => [ # child tag :cx(100), :cy(100), :r(50) # child tag attributes ], text => [ # child tag :x(10), :y(20), "hello" # child tag attributes ] ];

I used this data structure to generate bar charts in SVG, and found it very handy.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://789091]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2025-11-13 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (69 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.