diff --git a/mozilla/extensions/transformiix/source/base/MozillaString.cpp b/mozilla/extensions/transformiix/source/base/MozillaString.cpp index 39ad2665b8c..f7b503dc750 100644 --- a/mozilla/extensions/transformiix/source/base/MozillaString.cpp +++ b/mozilla/extensions/transformiix/source/base/MozillaString.cpp @@ -537,8 +537,22 @@ MBool String::isEqual(const String& data) const return MB_FALSE; else { - if (ptrNSString->EqualsWithConversion((PRUnichar *)data.toUnicode(), - PR_FALSE, data.length()) == PR_TRUE) + if (ptrNSString->EqualsWithConversion(data.getConstNSString()) == PR_TRUE) + return MB_TRUE; + else + return MB_FALSE; + } +} + +MBool String::isEqualIgnoreCase(const String& data) const +{ + if (this == &data) + return MB_TRUE; + else if (length() != data.length()) + return MB_FALSE; + else + { + if (ptrNSString->EqualsIgnoreCase(data.getConstNSString()) == PR_TRUE) return MB_TRUE; else return MB_FALSE; diff --git a/mozilla/extensions/transformiix/source/base/TxString.h b/mozilla/extensions/transformiix/source/base/TxString.h index 3bb0b3ba94b..38cebfccdb1 100644 --- a/mozilla/extensions/transformiix/source/base/TxString.h +++ b/mozilla/extensions/transformiix/source/base/TxString.h @@ -207,6 +207,9 @@ class String : public MITREObject virtual MBool isEqual(const String& data) const; //Check equality between //strings +#ifdef MOZ_XSL + virtual MBool isEqualIgnoreCase(const String& data) const; +#endif //Returns index of last occurrence of data virtual Int32 lastIndexOf(UNICODE_CHAR data) const; diff --git a/mozilla/extensions/transformiix/source/xml/NamespaceResolver.h b/mozilla/extensions/transformiix/source/xml/NamespaceResolver.h index 07241f1b6d4..042109e7fed 100644 --- a/mozilla/extensions/transformiix/source/xml/NamespaceResolver.h +++ b/mozilla/extensions/transformiix/source/xml/NamespaceResolver.h @@ -16,7 +16,7 @@ * Peter Van der Beken, Peter.VanderBeken@pandora.be * -- original author. * - * $Id: NamespaceResolver.h,v 1.3 2000-11-07 10:47:17 kvisco%ziplink.net Exp $ + * $Id: NamespaceResolver.h,v 1.4 2001-01-22 20:23:43 axel%pike.org Exp $ */ @@ -35,7 +35,7 @@ public: /** * Returns the namespace URI for the given name **/ - virtual void getNameSpaceURI(const String& name, String& nameSpaceURI) = 0; + virtual void getResultNameSpaceURI(const String& name, String& nameSpaceURI) = 0; /** * Returns the namespace URI for the given namespace prefix diff --git a/mozilla/extensions/transformiix/source/xml/XMLDOMUtils.cpp b/mozilla/extensions/transformiix/source/xml/XMLDOMUtils.cpp index bc935245eea..9566c2a3596 100644 --- a/mozilla/extensions/transformiix/source/xml/XMLDOMUtils.cpp +++ b/mozilla/extensions/transformiix/source/xml/XMLDOMUtils.cpp @@ -21,13 +21,13 @@ * Keith Visco * -- original author. * - * $Id: XMLDOMUtils.cpp,v 1.9 2001-01-22 09:32:40 kvisco%ziplink.net Exp $ + * $Id: XMLDOMUtils.cpp,v 1.10 2001-01-22 20:23:44 axel%pike.org Exp $ */ /** * XMLDOMUtils * @author Keith Visco - * @version $Revision: 1.9 $ $Date: 2001-01-22 09:32:40 $ + * @version $Revision: 1.10 $ $Date: 2001-01-22 20:23:44 $ **/ #include "XMLDOMUtils.h" @@ -86,7 +86,7 @@ Node* XMLDOMUtils::copyNode(Node* node, Document* owner, NamespaceResolver* reso #ifdef MOZ_XSL String name, nameSpaceURI; name = element->getNodeName(); - resolver->getNameSpaceURI(name, nameSpaceURI); + resolver->getResultNameSpaceURI(name, nameSpaceURI); Element* newElement = owner->createElementNS(nameSpaceURI, name); #else Element* newElement = owner->createElement(element->getNodeName()); @@ -98,7 +98,7 @@ Node* XMLDOMUtils::copyNode(Node* node, Document* owner, NamespaceResolver* reso for ( i = 0; i < attList->getLength(); i++ ) { Attr* attr = (Attr*) attList->item(i); #ifdef MOZ_XSL - resolver->getNameSpaceURI(attr->getName(), nameSpaceURI); + resolver->getResultNameSpaceURI(attr->getName(), nameSpaceURI); newElement->setAttributeNS(nameSpaceURI, attr->getName(), attr->getValue()); #else newElement->setAttribute(attr->getName(), attr->getValue()); diff --git a/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaDocument.cpp b/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaDocument.cpp index 4f82e2efc68..95b55ec30eb 100644 --- a/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaDocument.cpp +++ b/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaDocument.cpp @@ -130,7 +130,7 @@ Element* Document::getDocumentElement() } /** - * Call nsIDOMDocument::GetDocumentElement to get the document's DocumentType. + * Call nsIDOMDocument::GetDoctype to get the document's DocumentType. * * @return the DocumentType */ diff --git a/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaNamedNodeMap.cpp b/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaNamedNodeMap.cpp index f40e9307af8..6852d5a6759 100644 --- a/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaNamedNodeMap.cpp +++ b/mozilla/extensions/transformiix/source/xml/dom/mozImpl/MozillaNamedNodeMap.cpp @@ -51,7 +51,7 @@ NamedNodeMap::~NamedNodeMap() /** * Wrap a different Mozilla object with this wrapper. * - * @param aNamedNodeMap the nsIDOMNodeList you want to wrap + * @param aNamedNodeMap the nsIDOMNamedNodeMap you want to wrap */ void NamedNodeMap::setNSObj(nsIDOMNamedNodeMap* aNamedNodeMap) { diff --git a/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp b/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp index 0711f620d4c..3c472b81a47 100644 --- a/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp +++ b/mozilla/extensions/transformiix/source/xpath/StringFunctionCall.cpp @@ -21,14 +21,14 @@ * Keith Visco, kvisco@ziplink.net * -- original author. * - * $Id: StringFunctionCall.cpp,v 1.6 2001-01-12 20:06:37 axel%pike.org Exp $ + * $Id: StringFunctionCall.cpp,v 1.7 2001-01-22 20:23:47 axel%pike.org Exp $ */ /** * StringFunctionCall * A representation of the XPath String funtions * @author Keith Visco - * @version $Revision: 1.6 $ $Date: 2001-01-12 20:06:37 $ + * @version $Revision: 1.7 $ $Date: 2001-01-22 20:23:47 $ **/ #include "FunctionLib.h" @@ -254,8 +254,8 @@ ExprResult* StringFunctionCall::evaluate(Node* context, ContextState* cs) { for (i = 0; i < size; i++) { Int32 idx = oldChars.indexOf(chars[i]); if (idx >= 0) { - UNICODE_CHAR nchar = newChars.charAt(idx); - if (nchar != -1) src.append(nchar); + if (idxpeek(); +#ifdef MOZ_XSL + String nameSpaceURI, name, localName; +#endif switch (node->getNodeType()) { @@ -200,9 +203,8 @@ MBool ProcessorState::addToResultTree(Node* node) { Element* element = (Element*)current; Attr* attr = (Attr*)node; #ifdef MOZ_XSL - String nameSpaceURI, name; name = attr->getName(); - getNameSpaceURI(name, nameSpaceURI); + getResultNameSpaceURI(name, nameSpaceURI); // XXX HACK (pvdb) Workaround for BUG 51656 Html rendered as xhtml if (getOutputFormat()->isHTMLOutput()) { name.toLowerCase(); @@ -227,6 +229,19 @@ MBool ProcessorState::addToResultTree(Node* node) { current->appendChild(wrapper); current = wrapper; } +#ifdef MOZ_XSL + else { + // Checking if we should set the output method to HTML + name = node->getNodeName(); + XMLUtils::getLocalPart(name, localName); + if (localName.isEqualIgnoreCase(HTML)) { + setOutputMethod(HTML); + // XXX HACK (pvdb) Workaround for BUG 51656 + // Html rendered as xhtml + name.toLowerCase(); + } + } +#endif } current->appendChild(node); break; diff --git a/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp b/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp index 4b1f8e41c71..1da8de33b01 100644 --- a/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp +++ b/mozilla/extensions/transformiix/source/xslt/XSLTProcessor.cpp @@ -38,7 +38,7 @@ * Olivier Gerardin * -- Changed behavior of passing parameters to templates * - * $Id: XSLTProcessor.cpp,v 1.30 2001-01-22 15:53:06 axel%pike.org Exp $ + * $Id: XSLTProcessor.cpp,v 1.31 2001-01-22 20:23:50 axel%pike.org Exp $ */ #include "XSLTProcessor.h" @@ -53,7 +53,7 @@ /** * XSLTProcessor is a class for Processing XSL styelsheets * @author Keith Visco - * @version $Revision: 1.30 $ $Date: 2001-01-22 15:53:06 $ + * @version $Revision: 1.31 $ $Date: 2001-01-22 20:23:50 $ **/ /** @@ -1639,10 +1639,7 @@ void XSLTProcessor::xslCopy(Node* node, Element* action, ProcessorState* ps) { } String nameSpaceURI; - String prefix; - int idx = nodeName.indexOf(':'); - if (idx >= 0) nodeName.subString(0, idx, prefix); - XMLDOMUtils::getNameSpace(prefix, element, nameSpaceURI); + ps->getResultNameSpaceURI(nodeName, nameSpaceURI); // XXX HACK (pvdb) Workaround for BUG 51656 Html rendered as xhtml if (ps->getOutputFormat()->isHTMLOutput()) { nodeName.toLowerCase();