wanadlan has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: convert text to xml
by mirod (Canon) on Jan 31, 2003 at 17:56 UTC

    You are not giving us nearly enough information to help you here. What kind of text? what kind of XML? Have a look at CPAN: CGI::XML, CGI::XMLForm or XML::Generator::CGI might help you (I have used neither of them), but who knows?

Re: convert text to xml
by dragonchild (Archbishop) on Jan 31, 2003 at 18:35 UTC
    XML is eXtensible Markup Language. It is text. It's not some magical thing. It's not a programming language like Perl, Java, or C++. It's just like HTML - a way of embedding context and structure in with text.

    You can add XML to text to add structure, just like you would do so with HTML. XML isn't a format, not like PDF or DOC or TXT or such.

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      It's not some magical thing. It's not a programming language like Perl, Java, or C++...

      Hmm, obviously Perl poetry is plain text converted to Perl but how would I convert plain text to Java or C++? :-)

        Uh ... no. Perl poetry is not plain text converted to Perl. It's Perl given a context humans can interpret other than as a computer program. You can write Java poetry and C++ poetry. I'm not sure it would be as pretty, but it's do-able. (Heck, you can write ASM poetry, but I have no idea who would find that interesting. Still, people like piano-playing involving 2x4's ... it takes all types, I guess.)

        ------
        We are the carpenters and bricklayers of the Information Age.

        Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Re: convert text to xml
by petesmiley (Friar) on Jan 31, 2003 at 21:49 UTC
    Generically speaking, I would recommend XML::Writer. It cleans your stuff up for you as you write it out to the file. But this is a limited suggestion as the previous posters have pointed out.