[xml] patch for format output



Hi,

here a small patch for nicer formatted indent output.
(applicable on 2.5.8 tree.c)

regards,
Peter


*** tree.c      Mon Jul  7 08:12:21 2003
--- tree.c      Mon Jul  7 08:14:41 2003
***************
*** 7030,7036 ****
            for (i = 0;i < level;i++)
                xmlOutputBufferWriteString(buf, xmlTreeIndentString);
          xmlNodeDumpOutputInternal(buf, doc, cur, level, format, encoding);
!       if (format) {
            xmlOutputBufferWriteString(buf, "\n");
        }
        cur = cur->next;
--- 7030,7036 ----
            for (i = 0;i < level;i++)
                xmlOutputBufferWriteString(buf, xmlTreeIndentString);
          xmlNodeDumpOutputInternal(buf, doc, cur, level, format, encoding);
!       if ((format) && (cur->type != XML_TEXT_NODE)) {
            xmlOutputBufferWriteString(buf, "\n");
        }
        cur = cur->next;
***************
*** 7195,7204 ****
        }
      }
      if (cur->children != NULL) {
!       if (format) xmlOutputBufferWriteString(buf, "\n");
        xmlNodeListDumpOutput(buf, doc, cur->children,
                        (level >= 0?level+1:-1), format, encoding);
!       if ((xmlIndentTreeOutput) && (format))
            for (i = 0;i < level;i++)
                xmlOutputBufferWriteString(buf, xmlTreeIndentString);
      }
--- 7195,7205 ----
        }
      }
      if (cur->children != NULL) {
!       if (format && cur->children->type != XML_TEXT_NODE)
!           xmlOutputBufferWriteString(buf, "\n");
        xmlNodeListDumpOutput(buf, doc, cur->children,
                        (level >= 0?level+1:-1), format, encoding);
!       if ((xmlIndentTreeOutput) && (format) && (cur->children->type != XML_TEXT_NODE))
            for (i = 0;i < level;i++)
                xmlOutputBufferWriteString(buf, xmlTreeIndentString);
      }





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]