dbertoni 00/10/03 08:23:35
Modified: c/src/XSLT ElemLiteralResult.cpp
Log:
Fixed bug with generating attributes with empty values.
Revision Changes Path
1.22 +21 -18 xml-xalan/c/src/XSLT/ElemLiteralResult.cpp
Index: ElemLiteralResult.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XSLT/ElemLiteralResult.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ElemLiteralResult.cpp 2000/09/05 21:56:35 1.21
+++ ElemLiteralResult.cpp 2000/10/03 15:23:35 1.22
@@ -206,6 +206,11 @@
+// $$$ ToDo: Get rid of this when we get rid of Xerces' DOMString!!!
+static const XalanDOMChar theDummy = 0;
+
+
+
void
ElemLiteralResult::execute(
StylesheetExecutionContext&
executionContext,
@@ -225,31 +230,29 @@
{
const AVT* const avt = m_avts[i];
- XalanDOMString theStringedValue;
+ XalanDOMString thePrefix;
- avt->evaluate(theStringedValue, sourceNode, *this,
executionContext);
+ const XalanDOMString& theName = avt->getName();
- if(isEmpty(theStringedValue) == false)
+ if (startsWith(theName,
DOMServices::s_XMLNamespaceWithSeparator) == true)
{
- XalanDOMString thePrefix;
+ thePrefix = substring(theName,
DOMServices::s_XMLNamespaceWithSeparatorLength);
+ }
- const XalanDOMString& theName =
avt->getName();
+ XalanDOMString theStringedValue;
+
+ avt->evaluate(theStringedValue, sourceNode, *this,
executionContext);
- if (startsWith(theName,
DOMServices::s_XMLNamespaceWithSeparator) == true)
- {
- thePrefix = substring(theName,
DOMServices::s_XMLNamespaceWithSeparatorLength);
- }
-
- if (isEmpty(thePrefix) == true ||
- shouldExcludeResultNamespaceNode(
- thePrefix,
- theStringedValue) == false)
- {
-
executionContext.replacePendingAttribute(
+ if (isEmpty(thePrefix) == true ||
+ shouldExcludeResultNamespaceNode(
+ thePrefix,
+ theStringedValue) == false)
+ {
+ // $$$ ToDo: Get rid of theDummy when we get
rid of Xerces' DOMString!!!
+ executionContext.replacePendingAttribute(
c_wstr(avt->getName()),
c_wstr(avt->getType()),
- c_wstr(theStringedValue));
- }
+ length(theStringedValue) == 0 ?
&theDummy : c_wstr(theStringedValue));
}
}
}