diff --git a/src/dom/xmlwriter.cpp b/src/dom/xmlwriter.cpp
index 08fd653e7626aa1404bb736f8a9ad762e3f398f2..2b056cf9fe10cf7bef82d6e31d91c328e1a22244 100644 (file)
--- a/src/dom/xmlwriter.cpp
+++ b/src/dom/xmlwriter.cpp
* Authors:
* Bob Jamison
*
- * Copyright (C) 2005 Bob Jamison
+ * Copyright (C) 2005-2008 Bob Jamison
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
/**
*
*/
-void XmlWriter::po(char *fmt, ...)
+void XmlWriter::po(const char *fmt, ...)
{
char str[257];
va_list args;
/**
*
*/
-void XmlWriter::write(const Node *nodeArg)
+void XmlWriter::write(const NodePtr nodeArg)
{
- Node *node = (Node *)nodeArg;
+ NodePtr node = nodeArg;
indent+=2;
- NamedNodeMap *attributes = node->getAttributes();
- int nrAttrs = attributes->getLength();
+ NamedNodeMap attributes = node->getAttributes();
+ int nrAttrs = attributes.getLength();
//### Start open tag
spaces();
//### Attributes
for (int i=0 ; i<nrAttrs ; i++)
{
- Node *attr = attributes->item(i);
+ NodePtr attr = attributes.item(i);
spaces();
pos(attr->getNodeName());
po("=\"");
pos(node->getNodeValue());
//### Children
- for (Node *child = node->getFirstChild() ;
- child ;
+ for (NodePtr child = node->getFirstChild() ;
+ child.get() ;
child=child->getNextSibling())
{
write(child);
/**
*
*/
-void XmlWriter::writeFile(FILE *f, const Node *node)
+void XmlWriter::writeFile(FILE *f, const NodePtr node)
{
if (!node)
{
write(node);
- for (int i=0 ; i<buf.size() ; i++)
+ for (unsigned int i=0 ; i<buf.size() ; i++)
{
int ch = buf[i];
fputc(ch, f);