The attached patch replaces the previous one, and removes all
excess verbosity. I hope...
.robin.
diff -Naur Sablot-0.40/Sablot/output.cpp Sablot-0.40-patched/Sablot/output.cpp
--- Sablot-0.40/Sablot/output.cpp Fri Jun 30 11:23:25 2000
+++ Sablot-0.40-patched/Sablot/output.cpp Fri Jun 30 18:37:47 2000
@@ -278,7 +278,8 @@
}
eFlag PhysicalOutputLayerObj::outputElementStart(const Str& name,
- const StrStrList& namespaces, const QNameStrList& atts, Bool isEmpty)
+ const StrStrList& namespaces, const int namespace_index,
+ const QNameStrList& atts, Bool isEmpty)
{
// begin output of start tag: output element name
@@ -289,7 +290,7 @@
int i;
const Str* prefix;
- for (i = 0; i < namespaces.number(); i++)
+ for (i = namespace_index; i < namespaces.number(); i++)
{
sendLit(" xmlns");
prefix = &(namespaces[i] -> key);
@@ -1008,7 +1009,9 @@
eFlag OutputterObj::eventNamespace(const Str& prefix, const Str& uri)
{
assert(state == STATE_IN_MARKUP);
- currNamespaces.appendConstruct(prefix, uri);
+ Str * existing_namespace = currNamespaces.find (prefix);
+ if (!existing_namespace || !(*existing_namespace == uri))
+ currNamespaces.appendConstruct(prefix, uri);
return OK;
}
@@ -1128,7 +1131,7 @@
return OK;
if (physical)
E( physical -> outputElementStart(currElement.getname(),
- currNamespaces, currAtts, isEmpty) );
+ currNamespaces, getFirstOwnNS(), currAtts, isEmpty) );
if (mySAXHandler)
{
const char**
diff -Naur Sablot-0.40/Sablot/output.h Sablot-0.40-patched/Sablot/output.h
--- Sablot-0.40/Sablot/output.h Fri Jun 30 11:23:25 2000
+++ Sablot-0.40-patched/Sablot/output.h Fri Jun 30 17:53:50 2000
@@ -111,7 +111,8 @@
~PhysicalOutputLayerObj();
eFlag setOptions(DataLine *targetDataLine_, OutputDefinition *outDef_);
eFlag outputElementStart(const Str& name,
- const StrStrList& namespaces, const QNameStrList& atts, Bool isEmpty);
+ const StrStrList& namespaces, const int namespace_index,
+ const QNameStrList& atts, Bool isEmpty);
eFlag outputElementEnd(const Str& name, Bool isEmpty);
eFlag outputText(const Str& contents, Bool outputEscaping, Bool inHTMLSpecial);
eFlag outputComment(const Str& contents);