dbertoni 2002/11/19 09:10:51
Modified: c/src/XMLSupport FormatterToHTML.cpp FormatterToXML.cpp
Log:
Filter out dummy XML namespace attribute we add to the source tree.
Revision Changes Path
1.77 +26 -18 xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp
Index: FormatterToHTML.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToHTML.cpp,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- FormatterToHTML.cpp 5 Sep 2002 07:09:23 -0000 1.76
+++ FormatterToHTML.cpp 19 Nov 2002 17:10:50 -0000 1.77
@@ -850,30 +850,38 @@
const XalanDOMChar*
value,
const XalanHTMLElementsProperties::ElementProperties&
elemProperties)
{
- accumContent(XalanUnicode::charSpace);
+ // We add a fake attribute to the source tree to
+ // declare the xml prefix, so we filter it back out
+ // here...
+ // $$$ ToDo: It would be better if we didn't have to do
+ // this here.
+ if (equals(name, DOMServices::s_XMLNamespacePrefix) == false)
+ {
+ accumContent(XalanUnicode::charSpace);
- if((length(value) == 0 || equalsIgnoreCaseASCII(name, value)) &&
- elemProperties.isAttribute(name,
XalanHTMLElementsProperties::ATTREMPTY) == true)
- {
- accumName(name);
- }
- else
- {
- accumName(name);
- accumContent(XalanUnicode::charEqualsSign);
- accumContent(XalanUnicode::charQuoteMark);
-
- if(elemProperties.isAttribute(name,
XalanHTMLElementsProperties::ATTRURL) == true)
+ if((length(value) == 0 || equalsIgnoreCaseASCII(name, value)) &&
+ elemProperties.isAttribute(name,
XalanHTMLElementsProperties::ATTREMPTY) == true)
{
- writeAttrURI(value);
+ accumName(name);
}
else
{
- writeAttrString(value);
- }
+ accumName(name);
+ accumContent(XalanUnicode::charEqualsSign);
+ accumContent(XalanUnicode::charQuoteMark);
- accumContent(XalanUnicode::charQuoteMark);
- }
+ if(elemProperties.isAttribute(name,
XalanHTMLElementsProperties::ATTRURL) == true)
+ {
+ writeAttrURI(value);
+ }
+ else
+ {
+ writeAttrString(value);
+ }
+
+ accumContent(XalanUnicode::charQuoteMark);
+ }
+ }
}
1.62 +18 -6 xml-xalan/c/src/XMLSupport/FormatterToXML.cpp
Index: FormatterToXML.cpp
===================================================================
RCS file: /home/cvs/xml-xalan/c/src/XMLSupport/FormatterToXML.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- FormatterToXML.cpp 6 Sep 2002 04:12:10 -0000 1.61
+++ FormatterToXML.cpp 19 Nov 2002 17:10:51 -0000 1.62
@@ -73,6 +73,10 @@
+#include <DOMSupport/DOMServices.hpp>
+
+
+
static const XalanDOMChar theDefaultAttrSpecialChars[] =
{
XalanUnicode::charLessThanSign,
@@ -1619,12 +1623,20 @@
const XalanDOMChar* name,
const XalanDOMChar* value)
{
- accumContent(XalanUnicode::charSpace);
- accumName(name);
- accumContent(XalanUnicode::charEqualsSign);
- accumContent(XalanUnicode::charQuoteMark);
- writeAttrString(value);
- accumContent(XalanUnicode::charQuoteMark);
+ // We add a fake attribute to the source tree to
+ // declare the xml prefix, so we filter it back out
+ // here...
+ // $$$ ToDo: It would be better if we didn't have to do
+ // this here.
+ if (equals(name, DOMServices::s_XMLNamespacePrefix) == false)
+ {
+ accumContent(XalanUnicode::charSpace);
+ accumName(name);
+ accumContent(XalanUnicode::charEqualsSign);
+ accumContent(XalanUnicode::charQuoteMark);
+ writeAttrString(value);
+ accumContent(XalanUnicode::charQuoteMark);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]