Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

xml document preface

by fionbarr (Friar)
on May 20, 2013 at 15:05 UTC ( #1034350=perlquestion: print w/replies, xml ) Need Help??
fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

xml_writer constructs this preface:
<?xml version="1.0"?>
Is there anything else that (advisedly) might be included?

Replies are listed 'Best First'.
Re: xml document preface
by Your Mother (Bishop) on May 20, 2013 at 15:52 UTC
    perl -MXML::LibXML -le 'print XML::LibXML->load_xml( string => "<root/ +>" )->serialize' <?xml version="1.0"?> <root/>

    Agreement there. The encoding needs to be included if it's anything past ASCII/encoded entities.

Re: xml document preface
by sundialsvc4 (Abbot) on May 21, 2013 at 20:02 UTC

    This-much, of course, is the minimal specification needed to say, “this is an XML file,” and absent any encoding issues.   Has anyone experimented with that, to see if encoding directives are ever included, in some appropriate circumstance?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1034350]
Approved by ww
Front-paged by Corion
[LanX]: # Pestis Africana Suum
[erix]: that's an old plan, I think. Isn't there already a danewal (or some such name)?
[marto]: Build with -Wall
[erix]: Danewerk
[LanX]: I seem to remember that the danewall was build by the Frankish empire against the Danes
[erix]: 500 AD thru viking age
[erix]: that would make sense but wikipedia thinks otherwise
[LanX]: oh me was wrong ...
[erix]: but it always works both ways of course
[LanX]: Funny some weeks ago, I met people from the Cimbrian peninsula who didn't know it's called the Cimbrian peninsula ...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2018-03-22 18:42 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (283 votes). Check out past polls.