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

Re^2: Operating on XML, or XML::Simple is too simple!

by jdtoronto (Prior)
on Aug 05, 2005 at 15:28 UTC ( #481281=note: print w/replies, xml ) Need Help??


in reply to Re: Operating on XML, or XML::Simple is too simple!
in thread Operating on XML, or XML::Simple is too simple!

Graff,
update: Sorry, I think I may have misunderstood. You are actually looking for a way to take a bunch of new data (from some non-XML source, like a database or flat file) and push them out in the XML format shown in the example -- is that it? You want a template with placeholders where you can plug in fresh values.
Pretty much hots it on the head.

I don't care about the XML. To me XML is a way of structuring data that is yet another way of structuring data. The idea of XML::Simple converting the XML to a Perl structure which could be modified has worked well for me before. But sadly XML::Simple fails my simple test of simplicity. If I take some XML, parse it and then output it with no other processing, it should be the same.

That being said. I moved on and asked the question here. I suppose what I really want is the HTML::Template version of XML! The data in the XML example is a job submission. Essentially: send these message files to these recipients. I have installed XML::Twig, but at first look it is daunting, but I suspect that if I perservere it will all work out in the end.

Many thanks, John jdtoronto

  • Comment on Re^2: Operating on XML, or XML::Simple is too simple!

Replies are listed 'Best First'.
Re^3: Operating on XML, or XML::Simple is too simple!
by mirod (Canon) on Aug 05, 2005 at 15:34 UTC

    Would XML::Dumper be closer to what you are looking for? I would not let you read random XML, but it would let you read/write your data structures as XML.

      Mirod,

      I am not sure! I have read so many pages of XML documentation, module documentation, Perlmonks posts and article on the Web that I am beginning to be unsure about life itself!

      Fortunately I don't actually need to READ any XML. What I really need is to GENERATE XML in the very form that the sample documents came to me. My brain is exploding right now and I have found a devastatingly simple solution - trusty old HTML::Template!

      But I have no doubt that XML is going to become an all too regular part of my life, so I am going to need to do some learning. I have installed XML::Twig and read your tutorials online and I am impressed. When I have a little time I will work through some of the examples and no dount have more questions. THis is one of those days when I wish I could find someone who wanted me to design some hardware rather than write code!

      jdtoronto

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2020-12-05 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (63 votes). Check out past polls.

    Notices?