diff --git a/src/dom/xmlwriter.cpp b/src/dom/xmlwriter.cpp
index 08fd653e7626aa1404bb736f8a9ad762e3f398f2..13fe76e5af68fb2d32dbb4b76358fd49470ce585 100644 (file)
--- a/src/dom/xmlwriter.cpp
+++ b/src/dom/xmlwriter.cpp
/**
*
*/
-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);