[
Lists Home |
Date Index |
Thread Index
]
- From: David Megginson <david@megginson.com>
- To: XML-Dev List <xml-dev@xml.org>
- Date: Wed, 5 Apr 2000 08:45:59 -0400 (EDT)
I've just added XML::Writer 0.4 to my software page at
http://www.megginson.com/Software/
It is working its way into CPAN as we speak.
This version adds some extra functionality to make life easier for
people creating data-oriented XML (i.e. no mixed content). There is
now a 'data mode' that is disabled by default; when it is enabled,
XML::Writer automatically starts each element on a new line. It is
also possible to set the indent step (which is ignored unless data
mode is active). In safe mode, any mixed content in data mode will be
reported as an error.
There is also a new method, dataElement(name, data, atts...), for
producing elements that contain only character data content.
For example, here's some code:
my $writer = new XML::Writer;
$writer->setDataMode(1);
$writer->setDataIndent(2);
$writer->startTag("foo");
$writer->dataElement("bar", "abc", "id", "i01");
$writer->endTag("foo");
$writer->end();
This will produce the following XML:
<foo>
<bar id="i01">abc</bar>
</foo>
Zillions of people have sent e-mail asking for a feature like this,
and I'm tired of answering all of it, so here it is.
All the best,
David
--
David Megginson david@megginson.com
http://www.megginson.com/
Subject:
X-Mailer: VM 6.71 under 21.1 (patch 3) "Acadia" XEmacs Lucid
FCC: /home/david/Mail/sent
--text follows this line--
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|