Sign In/My Account | View Cart  
advertisement

Article:
 Three More For XML Output
Subject: JAXML
Date: 2003-10-20 09:11:27
From: Jerome Alet

jaxml currently doesn't correctly output UTF-8. With this limitation in mind, here's how to recreate Uche's xsa output in ISO-8859-1 :


--- CUT ---
#! /usr/bin/env python


import jaxml


x = jaxml.XML_document(encoding="ISO-8859-1")
x._text('<!DOCTYPE xsa PUBLIC "-//LM Garshol//DTD XML Software Autoupdate 1.0//EN//XML" "http://www.garshol.priv.no/download/xsa/xsa.dtd">')


x.xsa()


x._push()
x.vendor().name("Centigrade systems").email("info@centigrade.bogus")
x._pop()


# No need for a _push()+_pop() sequence
# on last group
x.product(id="100°").name("100° Server").version("1.0")
getattr(x, "last-release")("20030401") # ugly ?
x.changes()


x._output("test-xsa.xml")
--- CUT ---


No Previous Message Previous Message   Next Message Next Message


Full Text Titles Only Newest First
  • JAXML
    2003-10-21 00:42:33 Jerome Alet

Sponsored By: