Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: XML::Generator and namespace

by Anonymous Monk
on Aug 21, 2012 at 20:26 UTC ( [id://988850]=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Generator and namespace
in thread XML::Generator and namespace

In your example, you don't want the <rss> tag to be in the itunes: namespace, so you shouldn't be passing in a namespace to the corresponding XML::Generator call. All you need to do to get the xmlns:itunes attribute into the <rss> tag is to use that namespace in some embedded content. For example:
$itunes = XML::Generator->new(namespace=>[itunes=>'http://...']); $gen = XML::Generator->new(); print $gen->rss($itunes->author("Some Guy"))
This generates:
<rss xmlns:itunes="http://..."><itunes:author>Some Guy</itunes></rss>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found