XLM prolgoue

F

fscked

How do I go about creating the XML prologue like I want it to be?
Specifically, I am trying to add encoding and some namespace stuff.
 
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

fscked said:
How do I go about creating the XML prologue like I want it to be?
Specifically, I am trying to add encoding and some namespace stuff.

The XML declaration and the DTD that may appear in the prolog are
optional.

[22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'

If your encoding is UTF-8 (or ASCII ...) you don't need an XML
declaration. Otherwise everything depends on the XML lib you
use. For ElementTree, `tostring(elt, "ISO-8859-1")` for example
will automatically include the right declaration at the beginning
of your xml string ...

There is no namespace information inside the prolog. Such
"stuff" may appear inside the root element. Again, RTFM of
your specific XML lib :) For ElementTree, see
http://effbot.org/zone/element.htm#xml-namespaces

Cheers,

SB
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

fscked said:
How do I go about creating the XML prologue like I want it to be?

print "<?xml version='%s' encoding='%s'?> % (version, encoding)

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top