зеркало из https://github.com/mozilla/pjs.git
Bug 157142: get rid of txAtom typedef
r=Pike rs=peterv
This commit is contained in:
Родитель
caeca6c8ff
Коммит
d9daf78976
|
@ -1,81 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is TransforMiiX XSLT processor.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Jonas Sicking.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* Jonas Sicking. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Jonas Sicking <sicking@bigfoot.com>
|
||||
* Axel Hecht <axel@pike.org>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
* Atom implementation for standalone and wrapper for module
|
||||
*
|
||||
* For module,
|
||||
* txAtom is typedef'd to nsIAtom,
|
||||
* for standalone there is a separate implementation. The
|
||||
* code is all inlined in this header file.
|
||||
*
|
||||
* There is one major difference between the standalone and
|
||||
* the module implementation, module atoms are refcounted,
|
||||
* standalone atoms are not. Therefor code that is standalone
|
||||
* only may not use TX_RELEASE..ATOM, code that works in both
|
||||
* module and standalone has to pair these. Or you leak.
|
||||
*
|
||||
* To use this code standalone,
|
||||
* TX_IMPL_ATOM_STATICS;
|
||||
* has to appear in your source file.
|
||||
* XSLTProcessor.cpp does this.
|
||||
*/
|
||||
|
||||
#ifndef TRANSFRMX_ATOM_H
|
||||
#define TRANSFRMX_ATOM_H
|
||||
|
||||
#include "nsIAtom.h"
|
||||
|
||||
typedef nsIAtom txAtom;
|
||||
|
||||
#define TX_GET_ATOM(str) \
|
||||
NS_NewAtom(str)
|
||||
|
||||
#define TX_ADDREF_ATOM(atom) NS_ADDREF(atom)
|
||||
|
||||
#define TX_IF_ADDREF_ATOM(atom) NS_IF_ADDREF(atom)
|
||||
|
||||
#define TX_RELEASE_ATOM(atom) NS_RELEASE(atom)
|
||||
|
||||
#define TX_IF_RELEASE_ATOM(atom) NS_IF_RELEASE(atom)
|
||||
|
||||
#define TX_GET_ATOM_STRING(atom, string) \
|
||||
NS_SUCCEEDED((atom)->ToString(string))
|
||||
|
||||
#endif // TRANSFRMX_ATOM_H
|
|
@ -39,16 +39,16 @@
|
|||
|
||||
#include "txAtoms.h"
|
||||
|
||||
#define TX_ATOM(_name, _value) txAtom* txXMLAtoms::_name = 0
|
||||
#define TX_ATOM(_name, _value) nsIAtom* txXMLAtoms::_name = 0
|
||||
XML_ATOMS;
|
||||
#undef TX_ATOM
|
||||
#define TX_ATOM(_name, _value) txAtom* txXPathAtoms::_name = 0
|
||||
#define TX_ATOM(_name, _value) nsIAtom* txXPathAtoms::_name = 0
|
||||
#include "txXPathAtomList.h"
|
||||
#undef TX_ATOM
|
||||
#define TX_ATOM(_name, _value) txAtom* txXSLTAtoms::_name = 0
|
||||
#define TX_ATOM(_name, _value) nsIAtom* txXSLTAtoms::_name = 0
|
||||
#include "txXSLTAtomList.h"
|
||||
#undef TX_ATOM
|
||||
#define TX_ATOM(_name, _value) txAtom* txHTMLAtoms::_name = 0
|
||||
#define TX_ATOM(_name, _value) nsIAtom* txHTMLAtoms::_name = 0
|
||||
#include "txHTMLAtomList.h"
|
||||
#undef TX_ATOM
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ TX_ATOM(space, "space"); \
|
|||
TX_ATOM(xml, "xml"); \
|
||||
TX_ATOM(xmlns, "xmlns")
|
||||
|
||||
#define TX_ATOM(_name, _value) static txAtom* _name
|
||||
#define TX_ATOM(_name, _value) static nsIAtom* _name
|
||||
|
||||
class txXMLAtoms
|
||||
{
|
||||
|
|
|
@ -125,7 +125,7 @@ public:
|
|||
private:
|
||||
struct MapItem {
|
||||
PRInt32 mNamespaceID;
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mLocalName;
|
||||
TxObject* mValue;
|
||||
};
|
||||
|
||||
|
|
|
@ -210,7 +210,7 @@ MBool XMLUtils::getXMLSpacePreserve(Node* aNode)
|
|||
if (parent->getNodeType() == Node::ELEMENT_NODE) {
|
||||
Element* elem = (Element*)parent;
|
||||
if (elem->getAttr(txXMLAtoms::space, kNameSpaceID_XML, value)) {
|
||||
txAtom* val = TX_GET_ATOM(value);
|
||||
nsIAtom* val = TX_GET_ATOM(value);
|
||||
if (val == txXMLAtoms::preserve) {
|
||||
TX_IF_RELEASE_ATOM(val);
|
||||
return MB_TRUE;
|
||||
|
|
|
@ -43,8 +43,8 @@ public:
|
|||
}
|
||||
|
||||
txExpandedName(PRInt32 aNsID,
|
||||
txAtom* aLocalName) : mNamespaceID(aNsID),
|
||||
mLocalName(aLocalName)
|
||||
nsIAtom* aLocalName) : mNamespaceID(aNsID),
|
||||
mLocalName(aLocalName)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -87,9 +87,9 @@ class XMLUtils {
|
|||
|
||||
public:
|
||||
|
||||
static void getPrefix(const nsAString& src, txAtom** dest);
|
||||
static void getPrefix(const nsAString& src, nsIAtom** dest);
|
||||
static const nsDependentSubstring getLocalPart(const nsAString& src);
|
||||
static void getLocalPart(const nsAString& src, txAtom** dest);
|
||||
static void getLocalPart(const nsAString& src, nsIAtom** dest);
|
||||
|
||||
/**
|
||||
* Returns true if the given string is a valid XML QName
|
||||
|
|
|
@ -88,7 +88,7 @@ Node* Attr::getXPathParent()
|
|||
*
|
||||
* @return the node's localname atom
|
||||
*/
|
||||
MBool Attr::getLocalName(txAtom** aLocalName)
|
||||
MBool Attr::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName) {
|
||||
return MB_FALSE;
|
||||
|
|
|
@ -75,7 +75,7 @@ void Element::setAttributeNS(const nsAString& aNamespaceURI,
|
|||
/**
|
||||
* Call nsIContent::GetAttr for the localname and nsID.
|
||||
*/
|
||||
MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
||||
MBool Element::getAttr(nsIAtom* aLocalName, PRInt32 aNSID,
|
||||
nsAString& aValue)
|
||||
{
|
||||
nsCOMPtr<nsIContent> cont(do_QueryInterface(mMozObject));
|
||||
|
@ -93,7 +93,7 @@ MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
|||
/**
|
||||
* Call nsIContent::GetAttr for the localname and nsID.
|
||||
*/
|
||||
MBool Element::hasAttr(txAtom* aLocalName, PRInt32 aNSID)
|
||||
MBool Element::hasAttr(nsIAtom* aLocalName, PRInt32 aNSID)
|
||||
{
|
||||
nsCOMPtr<nsIContent> cont(do_QueryInterface(mMozObject));
|
||||
NS_ASSERTION(cont, "Element doesn't implement nsIContent");
|
||||
|
@ -108,7 +108,7 @@ MBool Element::hasAttr(txAtom* aLocalName, PRInt32 aNSID)
|
|||
*
|
||||
* @return the node's localname atom
|
||||
*/
|
||||
MBool Element::getLocalName(txAtom** aLocalName)
|
||||
MBool Element::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
NS_ENSURE_TRUE(aLocalName, MB_FALSE);
|
||||
nsCOMPtr<nsIContent> cont(do_QueryInterface(mMozObject));
|
||||
|
|
|
@ -254,7 +254,7 @@ nsresult Node::getNamespaceURI(nsAString& aNSURI)
|
|||
*
|
||||
* @return the node's localname atom
|
||||
*/
|
||||
MBool Node::getLocalName(txAtom** aLocalName)
|
||||
MBool Node::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName)
|
||||
return MB_FALSE;
|
||||
|
@ -290,7 +290,7 @@ Node* Node::getXPathParent()
|
|||
* @param prefix atom for prefix to look up
|
||||
* @return namespace ID for prefix
|
||||
*/
|
||||
PRInt32 Node::lookupNamespaceID(txAtom* aPrefix)
|
||||
PRInt32 Node::lookupNamespaceID(nsIAtom* aPrefix)
|
||||
{
|
||||
NSI_FROM_TX(Node);
|
||||
nsresult rv;
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* (C) Copyright The MITRE Corporation 1999 All rights reserved.
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License
|
||||
* Version 1.0 (the "License"); you may not use this file except in
|
||||
* compliance with the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* The program provided "as is" without any warranty express or
|
||||
* implied, including the warranty of non-infringement and the implied
|
||||
* warranties of merchantibility and fitness for a particular purpose.
|
||||
* The Copyright owner will not be liable for any damages suffered by
|
||||
* you as a result of using the Program. In no event will the Copyright
|
||||
* owner be liable for any special, indirect or consequential damages or
|
||||
* lost profits even if the Copyright owner has been advised of the
|
||||
* possibility of their occurrence.
|
||||
*
|
||||
* Please see release.txt distributed with this file for more information.
|
||||
*
|
||||
* Contributor(s): Tom Kneeland
|
||||
* Peter Van der Beken <peter.vanderbeken@pandora.be>
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implementation of the wrapper class to convert the Mozilla
|
||||
* nsIDOMProcessingInstruction interface into a TransforMiiX
|
||||
* ProcessingInstruction interface.
|
||||
*/
|
||||
|
||||
#include "mozilladom.h"
|
||||
#include "nsIDOMProcessingInstruction.h"
|
||||
#include "nsString.h"
|
||||
|
||||
/**
|
||||
* Construct a wrapper with the specified Mozilla object and document owner.
|
||||
*
|
||||
* @param aProcInstr the nsIDOMProcessingInstruction you want to wrap
|
||||
* @param aOwner the document that owns this object
|
||||
*/
|
||||
ProcessingInstruction::ProcessingInstruction(
|
||||
nsIDOMProcessingInstruction* aProcInstr,
|
||||
Document* aOwner) :
|
||||
Node (aProcInstr, aOwner)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
ProcessingInstruction::~ProcessingInstruction()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the local name atomized
|
||||
*
|
||||
* @return the node's localname atom
|
||||
*/
|
||||
MBool ProcessingInstruction::getLocalName(txAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName) {
|
||||
return MB_FALSE;
|
||||
}
|
||||
NSI_FROM_TX(ProcessingInstruction);
|
||||
nsAutoString target;
|
||||
nsProcessingInstruction->GetNodeName(target);
|
||||
*aLocalName = NS_NewAtom(target);
|
||||
NS_ENSURE_TRUE(*aLocalName, MB_FALSE);
|
||||
return MB_TRUE;
|
||||
}
|
|
@ -187,9 +187,9 @@ public:
|
|||
virtual nsresult getBaseURI(nsAString& aURI);
|
||||
|
||||
// txXPathNode functions
|
||||
virtual MBool getLocalName(txAtom** aLocalName);
|
||||
virtual MBool getLocalName(nsIAtom** aLocalName);
|
||||
virtual PRInt32 getNamespaceID();
|
||||
virtual PRInt32 lookupNamespaceID(txAtom* aPrefix);
|
||||
virtual PRInt32 lookupNamespaceID(nsIAtom* aPrefix);
|
||||
virtual Node* getXPathParent();
|
||||
virtual PRInt32 compareDocumentPosition(Node* aOther);
|
||||
|
||||
|
@ -292,9 +292,9 @@ public:
|
|||
const nsAString& aValue);
|
||||
|
||||
// txXPathNode functions
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getAttr(txAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
||||
MBool hasAttr(txAtom* aLocalName, PRInt32 aNSID);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
MBool getAttr(nsIAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
||||
MBool hasAttr(nsIAtom* aLocalName, PRInt32 aNSID);
|
||||
};
|
||||
|
||||
class txAttributeNodeKey
|
||||
|
@ -343,7 +343,7 @@ public:
|
|||
~Attr();
|
||||
|
||||
// txXPathNode functions override
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
Node* getXPathParent();
|
||||
|
||||
txAttributeNodeKey* GetKey() {
|
||||
|
@ -362,7 +362,7 @@ public:
|
|||
~ProcessingInstruction();
|
||||
|
||||
// txXPathNode functions
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -49,7 +49,7 @@ Attr::Attr(const nsAString& name, Document* owner):
|
|||
// namespace handling has to be handled late, the attribute must
|
||||
// be added to the tree to resolve the prefix, unless it's
|
||||
// xmlns or xml, try to do that here
|
||||
txAtom* prefixAtom = TX_GET_ATOM(Substring(nodeName, 0, idx));
|
||||
nsIAtom* prefixAtom = TX_GET_ATOM(Substring(nodeName, 0, idx));
|
||||
if (prefixAtom == txXMLAtoms::xmlns)
|
||||
mNamespaceID = kNameSpaceID_XMLNS;
|
||||
else if (prefixAtom == txXMLAtoms::xml)
|
||||
|
@ -104,7 +104,7 @@ Node* Attr::appendChild(Node* newChild)
|
|||
//
|
||||
//Return the attributes local (unprefixed) name atom.
|
||||
//
|
||||
MBool Attr::getLocalName(txAtom** aLocalName)
|
||||
MBool Attr::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName)
|
||||
return MB_FALSE;
|
||||
|
@ -126,7 +126,7 @@ PRInt32 Attr::getNamespaceID()
|
|||
mNamespaceID = kNameSpaceID_None;
|
||||
PRInt32 idx = nodeName.FindChar(':');
|
||||
if (idx != kNotFound) {
|
||||
nsCOMPtr<txAtom> prefixAtom = TX_GET_ATOM(Substring(nodeName, 0, idx));
|
||||
nsCOMPtr<nsIAtom> prefixAtom = TX_GET_ATOM(Substring(nodeName, 0, idx));
|
||||
mNamespaceID = lookupNamespaceID(prefixAtom);
|
||||
}
|
||||
return mNamespaceID;
|
||||
|
|
|
@ -99,7 +99,7 @@ Node* Element::appendChild(Node* newChild)
|
|||
//
|
||||
//Return the elements local (unprefixed) name.
|
||||
//
|
||||
MBool Element::getLocalName(txAtom** aLocalName)
|
||||
MBool Element::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName)
|
||||
return MB_FALSE;
|
||||
|
@ -182,7 +182,7 @@ void Element::setAttributeNS(const nsAString& aNamespaceURI,
|
|||
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||
while (item) {
|
||||
foundNode = (Attr*)item->node;
|
||||
txAtom* attrName;
|
||||
nsIAtom* attrName;
|
||||
if (foundNode->getLocalName(&attrName) &&
|
||||
namespaceID == foundNode->getNamespaceID() &&
|
||||
localName == attrName) {
|
||||
|
@ -219,14 +219,14 @@ Attr* Element::getAttributeNode(const nsAString& name)
|
|||
// exists, and sets aValue to the value of the attribute.
|
||||
// Return false, if the attribute does not exist.
|
||||
//
|
||||
MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
||||
MBool Element::getAttr(nsIAtom* aLocalName, PRInt32 aNSID,
|
||||
nsAString& aValue)
|
||||
{
|
||||
aValue.Truncate();
|
||||
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||
while (item) {
|
||||
Attr* attrNode = (Attr*)item->node;
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
if (attrNode->getLocalName(&localName) &&
|
||||
aNSID == attrNode->getNamespaceID() &&
|
||||
aLocalName == localName) {
|
||||
|
@ -244,12 +244,12 @@ MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
|||
// Return true if the attribute specified by localname and nsID
|
||||
// exists. Return false otherwise.
|
||||
//
|
||||
MBool Element::hasAttr(txAtom* aLocalName, PRInt32 aNSID)
|
||||
MBool Element::hasAttr(nsIAtom* aLocalName, PRInt32 aNSID)
|
||||
{
|
||||
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||
while (item) {
|
||||
Attr* attrNode = (Attr*)item->node;
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
if (attrNode->getLocalName(&localName) &&
|
||||
aNSID == attrNode->getNamespaceID() &&
|
||||
aLocalName == localName) {
|
||||
|
|
|
@ -266,7 +266,7 @@ MBool NodeDefinition::hasChildNodes() const
|
|||
return MB_FALSE;
|
||||
}
|
||||
|
||||
MBool NodeDefinition::getLocalName(txAtom** aLocalName)
|
||||
MBool NodeDefinition::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName)
|
||||
return MB_FALSE;
|
||||
|
@ -290,7 +290,7 @@ PRInt32 NodeDefinition::getNamespaceID()
|
|||
//
|
||||
// @return namespace associated with prefix
|
||||
//
|
||||
PRInt32 NodeDefinition::lookupNamespaceID(txAtom* aPrefix)
|
||||
PRInt32 NodeDefinition::lookupNamespaceID(nsIAtom* aPrefix)
|
||||
{
|
||||
// this is http://www.w3.org/2000/xmlns/,
|
||||
// ID = kNameSpaceID_XMLNS, see txNamespaceManager::Init
|
||||
|
|
|
@ -57,7 +57,7 @@ ProcessingInstruction::~ProcessingInstruction()
|
|||
//from all child manipulation functions.
|
||||
//
|
||||
|
||||
MBool ProcessingInstruction::getLocalName(txAtom** aLocalName)
|
||||
MBool ProcessingInstruction::getLocalName(nsIAtom** aLocalName)
|
||||
{
|
||||
if (!aLocalName)
|
||||
return MB_FALSE;
|
||||
|
|
|
@ -115,9 +115,9 @@ class Node : public TxObject
|
|||
virtual nsresult getNamespaceURI(nsAString& aNSURI) = 0;
|
||||
|
||||
//txXPathNode functions
|
||||
virtual MBool getLocalName(txAtom** aLocalName) = 0;
|
||||
virtual MBool getLocalName(nsIAtom** aLocalName) = 0;
|
||||
virtual PRInt32 getNamespaceID() = 0;
|
||||
virtual PRInt32 lookupNamespaceID(txAtom* aPrefix) = 0;
|
||||
virtual PRInt32 lookupNamespaceID(nsIAtom* aPrefix) = 0;
|
||||
virtual Node* getXPathParent() = 0;
|
||||
virtual PRInt32 compareDocumentPosition(Node* aOther) = 0;
|
||||
};
|
||||
|
@ -249,9 +249,9 @@ class NodeDefinition : public Node, public NodeList
|
|||
nsresult getNamespaceURI(nsAString& aNSURI);
|
||||
|
||||
//txXPathNode functions
|
||||
virtual MBool getLocalName(txAtom** aLocalName);
|
||||
virtual MBool getLocalName(nsIAtom** aLocalName);
|
||||
virtual PRInt32 getNamespaceID();
|
||||
virtual PRInt32 lookupNamespaceID(txAtom*);
|
||||
virtual PRInt32 lookupNamespaceID(nsIAtom*);
|
||||
virtual Node* getXPathParent();
|
||||
virtual PRInt32 compareDocumentPosition(Node* aOther);
|
||||
|
||||
|
@ -419,10 +419,10 @@ class Element : public NodeDefinition
|
|||
Node* appendChild(Node* newChild);
|
||||
|
||||
//txXPathNode functions override
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
PRInt32 getNamespaceID();
|
||||
MBool getAttr(txAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
||||
MBool hasAttr(txAtom* aLocalName, PRInt32 aNSID);
|
||||
MBool getAttr(nsIAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
||||
MBool hasAttr(nsIAtom* aLocalName, PRInt32 aNSID);
|
||||
|
||||
private:
|
||||
friend class Document;
|
||||
|
@ -431,7 +431,7 @@ class Element : public NodeDefinition
|
|||
Document* aOwner);
|
||||
|
||||
AttrMap mAttributes;
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mLocalName;
|
||||
PRInt32 mNamespaceID;
|
||||
};
|
||||
|
||||
|
@ -454,7 +454,7 @@ class Attr : public NodeDefinition
|
|||
Node* appendChild(Node* newChild);
|
||||
|
||||
//txXPathNode functions override
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
PRInt32 getNamespaceID();
|
||||
Node* getXPathParent();
|
||||
|
||||
|
@ -470,7 +470,7 @@ class Attr : public NodeDefinition
|
|||
|
||||
Element* ownerElement;
|
||||
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mLocalName;
|
||||
PRInt32 mNamespaceID;
|
||||
};
|
||||
|
||||
|
@ -488,14 +488,14 @@ class ProcessingInstruction : public NodeDefinition
|
|||
~ProcessingInstruction();
|
||||
|
||||
//txXPathNode functions override
|
||||
MBool getLocalName(txAtom** aLocalName);
|
||||
MBool getLocalName(nsIAtom** aLocalName);
|
||||
|
||||
private:
|
||||
friend class Document;
|
||||
ProcessingInstruction(const nsAString& theTarget, const nsAString& theData,
|
||||
Document* owner);
|
||||
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mLocalName;
|
||||
};
|
||||
|
||||
class txNamespaceManager
|
||||
|
|
|
@ -120,7 +120,7 @@ ExprResult* BooleanFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new StringResult(NS_LITERAL_STRING("error"));
|
||||
}
|
||||
|
||||
nsresult BooleanFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult BooleanFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case TX_BOOLEAN:
|
||||
|
|
|
@ -97,7 +97,7 @@ public:
|
|||
|
||||
#define TX_DECL_FUNCTION \
|
||||
TX_DECL_EVALUATE; \
|
||||
nsresult getNameAtom(txAtom** aAtom)
|
||||
nsresult getNameAtom(nsIAtom** aAtom)
|
||||
|
||||
/**
|
||||
* This class represents a FunctionCall as defined by the XPath 1.0
|
||||
|
@ -164,7 +164,7 @@ protected:
|
|||
/*
|
||||
* Returns the name of the function as an atom.
|
||||
*/
|
||||
virtual nsresult getNameAtom(txAtom** aAtom) = 0;
|
||||
virtual nsresult getNameAtom(nsIAtom** aAtom) = 0;
|
||||
}; //-- FunctionCall
|
||||
|
||||
|
||||
|
@ -224,7 +224,7 @@ public:
|
|||
* Creates a new txNameTest with the given type and the given
|
||||
* principal node type
|
||||
*/
|
||||
txNameTest(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID,
|
||||
txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
|
||||
Node::NodeType aNodeType);
|
||||
|
||||
~txNameTest();
|
||||
|
@ -232,8 +232,8 @@ public:
|
|||
TX_DECL_NODE_TEST;
|
||||
|
||||
private:
|
||||
txAtom* mPrefix;
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mPrefix;
|
||||
nsIAtom* mLocalName;
|
||||
PRInt32 mNamespace;
|
||||
Node::NodeType mNodeType;
|
||||
};
|
||||
|
@ -267,7 +267,7 @@ public:
|
|||
|
||||
private:
|
||||
NodeType mNodeType;
|
||||
txAtom* mNodeName;
|
||||
nsIAtom* mNodeName;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -554,14 +554,14 @@ class VariableRefExpr : public Expr {
|
|||
|
||||
public:
|
||||
|
||||
VariableRefExpr(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID);
|
||||
VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID);
|
||||
~VariableRefExpr();
|
||||
|
||||
TX_DECL_EXPR;
|
||||
|
||||
private:
|
||||
txAtom* mPrefix;
|
||||
txAtom* mLocalName;
|
||||
nsIAtom* mPrefix;
|
||||
nsIAtom* mLocalName;
|
||||
PRInt32 mNamespace;
|
||||
};
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ Expr* ExprParser::createFilterExpr(ExprLexer& lexer, txIParseContext* aContext)
|
|||
break;
|
||||
case Token::VAR_REFERENCE :
|
||||
{
|
||||
txAtom *prefix, *lName;
|
||||
nsIAtom *prefix, *lName;
|
||||
PRInt32 nspace;
|
||||
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
||||
lName, nspace);
|
||||
|
@ -490,7 +490,7 @@ Expr* ExprParser::createFunctionCall(ExprLexer& lexer,
|
|||
fnCall = new NumberFunctionCall(NumberFunctionCall::FLOOR);
|
||||
}
|
||||
else {
|
||||
txAtom *prefix, *lName;
|
||||
nsIAtom *prefix, *lName;
|
||||
PRInt32 namespaceID;
|
||||
rv = resolveQName(tok->value, prefix, aContext, lName, namespaceID);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -640,7 +640,7 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer,
|
|||
case Token::CNAME :
|
||||
{
|
||||
// resolve QName
|
||||
txAtom *prefix, *lName;
|
||||
nsIAtom *prefix, *lName;
|
||||
PRInt32 nspace;
|
||||
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
||||
lName, nspace);
|
||||
|
@ -1013,8 +1013,8 @@ short ExprParser::precedenceLevel(short tokenType) {
|
|||
}
|
||||
|
||||
nsresult ExprParser::resolveQName(const nsAString& aQName,
|
||||
txAtom*& aPrefix, txIParseContext* aContext,
|
||||
txAtom*& aLocalName, PRInt32& aNamespace)
|
||||
nsIAtom*& aPrefix, txIParseContext* aContext,
|
||||
nsIAtom*& aLocalName, PRInt32& aNamespace)
|
||||
{
|
||||
aNamespace = kNameSpaceID_None;
|
||||
PRInt32 idx = aQName.FindChar(':');
|
||||
|
|
|
@ -82,9 +82,9 @@ protected:
|
|||
* Resolve a QName, given the mContext parse context.
|
||||
* Returns prefix and localName as well as namespace ID
|
||||
**/
|
||||
static nsresult resolveQName(const nsAString& aQName, txAtom*& aPrefix,
|
||||
static nsresult resolveQName(const nsAString& aQName, nsIAtom*& aPrefix,
|
||||
txIParseContext* aContext,
|
||||
txAtom*& aLocalName, PRInt32& aNamespace);
|
||||
nsIAtom*& aLocalName, PRInt32& aNamespace);
|
||||
|
||||
/**
|
||||
* Using the given lexer, parses the tokens if they represent a
|
||||
|
|
|
@ -176,7 +176,7 @@ MBool FunctionCall::requireParams(int paramCountMin, txIEvalContext* aContext)
|
|||
**/
|
||||
void FunctionCall::toString(nsAString& aDest)
|
||||
{
|
||||
txAtom* functionNameAtom = 0;
|
||||
nsIAtom* functionNameAtom = 0;
|
||||
nsAutoString functionName;
|
||||
if (!NS_SUCCEEDED(getNameAtom(&functionNameAtom)) ||
|
||||
!TX_GET_ATOM_STRING(functionNameAtom, functionName)) {
|
||||
|
|
|
@ -161,7 +161,7 @@ ExprResult* NodeSetFunctionCall::evaluate(txIEvalContext* aContext) {
|
|||
case LOCAL_NAME:
|
||||
{
|
||||
nsAutoString localName;
|
||||
txAtom* localNameAtom;
|
||||
nsIAtom* localNameAtom;
|
||||
node->getLocalName(&localNameAtom);
|
||||
if (localNameAtom) {
|
||||
// Node has a localName
|
||||
|
@ -220,7 +220,7 @@ ExprResult* NodeSetFunctionCall::evaluate(txIEvalContext* aContext) {
|
|||
return new StringResult(NS_LITERAL_STRING("error"));
|
||||
}
|
||||
|
||||
nsresult NodeSetFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult NodeSetFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case COUNT:
|
||||
|
|
|
@ -138,7 +138,7 @@ ExprResult* NumberFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new StringResult(NS_LITERAL_STRING("error"));
|
||||
}
|
||||
|
||||
nsresult NumberFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult NumberFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case NUMBER:
|
||||
|
|
|
@ -251,7 +251,7 @@ ExprResult* StringFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new StringResult(NS_LITERAL_STRING("error"));
|
||||
}
|
||||
|
||||
nsresult StringFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult StringFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
switch (mType) {
|
||||
case CONCAT:
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
/**
|
||||
* Creates a VariableRefExpr with the given variable name
|
||||
**/
|
||||
VariableRefExpr::VariableRefExpr(txAtom* aPrefix, txAtom* aLocalName,
|
||||
VariableRefExpr::VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName,
|
||||
PRInt32 aNSID)
|
||||
: mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID)
|
||||
{
|
||||
|
|
|
@ -129,7 +129,7 @@ nsXPathEvaluator::Evaluate(const nsAString & aExpression,
|
|||
*/
|
||||
|
||||
nsresult nsXPathEvaluator::ParseContextImpl::resolveNamespacePrefix
|
||||
(txAtom* aPrefix, PRInt32& aID)
|
||||
(nsIAtom* aPrefix, PRInt32& aID)
|
||||
{
|
||||
nsAutoString prefix;
|
||||
if (aPrefix) {
|
||||
|
@ -155,7 +155,7 @@ nsresult nsXPathEvaluator::ParseContextImpl::resolveNamespacePrefix
|
|||
return gTxNameSpaceManager->RegisterNameSpace(ns, aID);
|
||||
}
|
||||
|
||||
nsresult nsXPathEvaluator::ParseContextImpl::resolveFunctionCall(txAtom* aName,
|
||||
nsresult nsXPathEvaluator::ParseContextImpl::resolveFunctionCall(nsIAtom* aName,
|
||||
PRInt32 aID,
|
||||
FunctionCall*& aFn)
|
||||
{
|
||||
|
|
|
@ -77,8 +77,8 @@ private:
|
|||
return mLastError;
|
||||
}
|
||||
|
||||
nsresult resolveNamespacePrefix(txAtom* aPrefix, PRInt32& aID);
|
||||
nsresult resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
nsresult resolveNamespacePrefix(nsIAtom* aPrefix, PRInt32& aID);
|
||||
nsresult resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
FunctionCall*& aFunction);
|
||||
void receiveError(const nsAString& aMsg, nsresult aRes);
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ nsXPathExpression::Evaluate(nsIDOMNode *aContextNode,
|
|||
*/
|
||||
|
||||
nsresult nsXPathExpression::EvalContextImpl::getVariable(PRInt32 aNamespace,
|
||||
txAtom* aLName,
|
||||
nsIAtom* aLName,
|
||||
ExprResult*& aResult)
|
||||
{
|
||||
aResult = 0;
|
||||
|
|
|
@ -56,7 +56,7 @@ PRUint32 txForwardContext::position()
|
|||
return (PRUint32)(pos+1);
|
||||
}
|
||||
|
||||
nsresult txForwardContext::getVariable(PRInt32 aNamespace, txAtom* aLName,
|
||||
nsresult txForwardContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||
ExprResult*& aResult)
|
||||
{
|
||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||
|
|
|
@ -66,13 +66,13 @@ public:
|
|||
/*
|
||||
* Return a namespaceID for a given prefix.
|
||||
*/
|
||||
virtual nsresult resolveNamespacePrefix(txAtom* aPrefix, PRInt32& aID) = 0;
|
||||
virtual nsresult resolveNamespacePrefix(nsIAtom* aPrefix, PRInt32& aID) = 0;
|
||||
|
||||
/*
|
||||
* Create a FunctionCall, needed for extension function calls and
|
||||
* XSLT. XPath function calls are resolved by the Parser.
|
||||
*/
|
||||
virtual nsresult resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
virtual nsresult resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
FunctionCall*& aFunction) = 0;
|
||||
|
||||
/*
|
||||
|
@ -101,7 +101,7 @@ public:
|
|||
* Return the ExprResult associated with the variable with the
|
||||
* given namespace and local name.
|
||||
*/
|
||||
virtual nsresult getVariable(PRInt32 aNamespace, txAtom* aLName,
|
||||
virtual nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||
ExprResult*& aResult) = 0;
|
||||
|
||||
/*
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
};
|
||||
|
||||
#define TX_DECL_MATCH_CONTEXT \
|
||||
nsresult getVariable(PRInt32 aNamespace, txAtom* aLName, \
|
||||
nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName, \
|
||||
ExprResult*& aResult); \
|
||||
MBool isStripSpaceAllowed(Node* aNode); \
|
||||
void receiveError(const nsAString& aMsg, nsresult aRes)
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include "txAtoms.h"
|
||||
#include "txIXPathContext.h"
|
||||
|
||||
txNameTest::txNameTest(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID,
|
||||
txNameTest::txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
|
||||
Node::NodeType aNodeType)
|
||||
:mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID),
|
||||
mNodeType(aNodeType)
|
||||
|
@ -66,7 +66,7 @@ MBool txNameTest::matches(Node* aNode, txIMatchContext* aContext)
|
|||
return MB_TRUE;
|
||||
|
||||
// Compare local-names
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
aNode->getLocalName(&localName);
|
||||
MBool result = localName == mLocalName;
|
||||
TX_IF_RELEASE_ATOM(localName);
|
||||
|
|
|
@ -55,7 +55,7 @@ PRUint32 txNodeSetContext::position()
|
|||
return mPosition;
|
||||
}
|
||||
|
||||
nsresult txNodeSetContext::getVariable(PRInt32 aNamespace, txAtom* aLName,
|
||||
nsresult txNodeSetContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||
ExprResult*& aResult)
|
||||
{
|
||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||
|
|
|
@ -64,7 +64,7 @@ MBool txNodeTypeTest::matches(Node* aNode, txIMatchContext* aContext)
|
|||
!aContext->isStripSpaceAllowed(aNode);
|
||||
case PI_TYPE:
|
||||
if (type == Node::PROCESSING_INSTRUCTION_NODE) {
|
||||
txAtom* localName = 0;
|
||||
nsIAtom* localName = 0;
|
||||
MBool result;
|
||||
result = !mNodeName ||
|
||||
(aNode->getLocalName(&localName) &&
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
~txSingleNodeContext()
|
||||
{}
|
||||
|
||||
nsresult getVariable(PRInt32 aNamespace, txAtom* aLName,
|
||||
nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||
ExprResult*& aResult)
|
||||
{
|
||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||
|
|
|
@ -154,7 +154,7 @@ void ProcessorState::addAttributeSet(Element* aAttributeSet,
|
|||
PRInt32 nsID = node->getNamespaceID();
|
||||
if (nsID != kNameSpaceID_XSLT)
|
||||
continue;
|
||||
txAtom* nodeName;
|
||||
nsIAtom* nodeName;
|
||||
if (!node->getLocalName(&nodeName) || !nodeName)
|
||||
continue;
|
||||
if (nodeName == txXSLTAtoms::attribute)
|
||||
|
@ -969,7 +969,7 @@ txDecimalFormat* ProcessorState::getDecimalFormat(const txExpandedName& aName)
|
|||
* @return the ExprResult which has been bound to the variable with the given
|
||||
* name
|
||||
**/
|
||||
nsresult ProcessorState::getVariable(PRInt32 aNamespace, txAtom* aLName,
|
||||
nsresult ProcessorState::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||
ExprResult*& aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -1102,7 +1102,7 @@ void ProcessorState::receiveError(const nsAString& errorMessage, nsresult aRes)
|
|||
**/
|
||||
#define CHECK_FN(_name) aName == txXSLTAtoms::_name
|
||||
|
||||
nsresult ProcessorState::resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
nsresult ProcessorState::resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
Element* aElem,
|
||||
FunctionCall*& aFunction)
|
||||
{
|
||||
|
@ -1195,7 +1195,7 @@ ProcessorState::ImportFrame::~ImportFrame()
|
|||
* txIParseContext used by ProcessorState internally
|
||||
*/
|
||||
|
||||
nsresult txPSParseContext::resolveNamespacePrefix(txAtom* aPrefix,
|
||||
nsresult txPSParseContext::resolveNamespacePrefix(nsIAtom* aPrefix,
|
||||
PRInt32& aID)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
@ -1210,7 +1210,7 @@ nsresult txPSParseContext::resolveNamespacePrefix(txAtom* aPrefix,
|
|||
return (aID != kNameSpaceID_Unknown) ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsresult txPSParseContext::resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
nsresult txPSParseContext::resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
FunctionCall*& aFunction)
|
||||
{
|
||||
return mPS->resolveFunctionCall(aName, aID, mStyle, aFunction);
|
||||
|
|
|
@ -350,7 +350,7 @@ public:
|
|||
* Returns a FunctionCall which has the given name.
|
||||
* @return the FunctionCall for the function with the given name.
|
||||
*/
|
||||
nsresult resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
nsresult resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
Element* aElem, FunctionCall*& aFunction);
|
||||
|
||||
#ifdef TX_EXE
|
||||
|
@ -482,7 +482,7 @@ private:
|
|||
*/
|
||||
class txNameTestItem {
|
||||
public:
|
||||
txNameTestItem(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID,
|
||||
txNameTestItem(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
|
||||
MBool stripSpace)
|
||||
: mNameTest(aPrefix, aLocalName, aNSID, Node::ELEMENT_NODE),
|
||||
mStrips(stripSpace)
|
||||
|
@ -522,8 +522,8 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
nsresult resolveNamespacePrefix(txAtom* aPrefix, PRInt32& aID);
|
||||
nsresult resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
||||
nsresult resolveNamespacePrefix(nsIAtom* aPrefix, PRInt32& aID);
|
||||
nsresult resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||
FunctionCall*& aFunction);
|
||||
void receiveError(const nsAString& aMsg, nsresult aRes);
|
||||
|
||||
|
|
|
@ -333,7 +333,7 @@ txXSLTProcessor::processAction(Node* aAction,
|
|||
}
|
||||
|
||||
Expr* expr = 0;
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
aAction->getLocalName(&localName);
|
||||
// xsl:apply-imports
|
||||
if (localName == txXSLTAtoms::applyImports) {
|
||||
|
@ -389,7 +389,7 @@ txXSLTProcessor::processAction(Node* aAction,
|
|||
while (child) {
|
||||
if (child->getNodeType() == Node::ELEMENT_NODE &&
|
||||
child->getNamespaceID() == kNameSpaceID_XSLT) {
|
||||
txAtom* childLocalName;
|
||||
nsIAtom* childLocalName;
|
||||
child->getLocalName(&childLocalName);
|
||||
if (childLocalName == txXSLTAtoms::sort) {
|
||||
sorter.addSortElement((Element*)child);
|
||||
|
@ -461,7 +461,7 @@ txXSLTProcessor::processAction(Node* aAction,
|
|||
return;
|
||||
}
|
||||
|
||||
txAtom* nameAtom = TX_GET_ATOM(name);
|
||||
nsIAtom* nameAtom = TX_GET_ATOM(name);
|
||||
if (nameAtom == txXMLAtoms::xmlns) {
|
||||
TX_RELEASE_ATOM(nameAtom);
|
||||
aPs->receiveError(NS_LITERAL_STRING("error processing xsl:attribute, name is xmlns."), NS_ERROR_FAILURE);
|
||||
|
@ -546,7 +546,7 @@ txXSLTProcessor::processAction(Node* aAction,
|
|||
}
|
||||
|
||||
Element* xslTemplate = (Element*)condition;
|
||||
txAtom* conditionLocalName;
|
||||
nsIAtom* conditionLocalName;
|
||||
condition->getLocalName(&conditionLocalName);
|
||||
if (conditionLocalName == txXSLTAtoms::when) {
|
||||
expr = aPs->getExpr(xslTemplate,
|
||||
|
@ -696,7 +696,7 @@ txXSLTProcessor::processAction(Node* aAction,
|
|||
while (child) {
|
||||
unsigned short nodeType = child->getNodeType();
|
||||
if (nodeType == Node::ELEMENT_NODE) {
|
||||
txAtom* childLocalName;
|
||||
nsIAtom* childLocalName;
|
||||
child->getLocalName(&childLocalName);
|
||||
if (child->getNamespaceID() != kNameSpaceID_XSLT ||
|
||||
childLocalName != txXSLTAtoms::sort) {
|
||||
|
@ -1125,7 +1125,7 @@ txXSLTProcessor::processParameters(Element* aAction,
|
|||
while (tmpNode) {
|
||||
if (tmpNode->getNodeType() == Node::ELEMENT_NODE &&
|
||||
tmpNode->getNamespaceID() == kNameSpaceID_XSLT) {
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
tmpNode->getLocalName(&localName);
|
||||
if (localName != txXSLTAtoms::withParam) {
|
||||
TX_IF_RELEASE_ATOM(localName);
|
||||
|
@ -1189,7 +1189,7 @@ txXSLTProcessor::processStylesheet(Document* aStylesheet,
|
|||
|
||||
Element* elem = aStylesheet->getDocumentElement();
|
||||
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
PRInt32 namespaceID = elem->getNamespaceID();
|
||||
elem->getLocalName(&localName);
|
||||
|
||||
|
@ -1228,7 +1228,7 @@ txXSLTProcessor::processTemplate(Node* aTemplate,
|
|||
while (tmpNode) {
|
||||
int nodeType = tmpNode->getNodeType();
|
||||
if (nodeType == Node::ELEMENT_NODE) {
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
tmpNode->getLocalName(&localName);
|
||||
if (tmpNode->getNamespaceID() != kNameSpaceID_XSLT ||
|
||||
localName != txXSLTAtoms::param) {
|
||||
|
@ -1319,7 +1319,7 @@ txXSLTProcessor::processTopLevel(Element* aStylesheet,
|
|||
Node* node = aStylesheet->getFirstChild();
|
||||
while (node && !importsDone) {
|
||||
if (node->getNodeType() == Node::ELEMENT_NODE) {
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
node->getLocalName(&localName);
|
||||
if (node->getNamespaceID() == kNameSpaceID_XSLT &&
|
||||
localName == txXSLTAtoms::import) {
|
||||
|
@ -1365,7 +1365,7 @@ txXSLTProcessor::processTopLevel(Element* aStylesheet,
|
|||
continue;
|
||||
}
|
||||
|
||||
txAtom* localName;
|
||||
nsIAtom* localName;
|
||||
node->getLocalName(&localName);
|
||||
Element* element = (Element*)node;
|
||||
// xsl:attribute-set
|
||||
|
|
|
@ -25,7 +25,7 @@ ExprResult* CurrentFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new NodeSet(mPs->getEvalContext()->getContextNode());
|
||||
}
|
||||
|
||||
nsresult CurrentFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult CurrentFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::current;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -128,7 +128,7 @@ ExprResult* DocumentFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return nodeSet;
|
||||
}
|
||||
|
||||
nsresult DocumentFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult DocumentFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::document;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -133,7 +133,7 @@ ExprResult* ElementAvailableFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsresult ElementAvailableFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult ElementAvailableFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::elementAvailable;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -132,7 +132,7 @@ ExprResult* FunctionAvailableFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsresult FunctionAvailableFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult FunctionAvailableFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::functionAvailable;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -101,7 +101,7 @@ ExprResult* GenerateIdFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new StringResult(NS_ConvertASCIItoUCS2(buf));
|
||||
}
|
||||
|
||||
nsresult GenerateIdFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult GenerateIdFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::generateId;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -64,7 +64,7 @@ ExprResult* SystemPropertyFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return result;
|
||||
}
|
||||
|
||||
nsresult SystemPropertyFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult SystemPropertyFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::systemProperty;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -476,7 +476,7 @@ ExprResult* txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
return new StringResult(res);
|
||||
} //-- evaluate
|
||||
|
||||
nsresult txFormatNumberFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult txFormatNumberFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::formatNumber;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -106,7 +106,7 @@ ExprResult* txKeyFunctionCall::evaluate(txIEvalContext* aContext)
|
|||
|
||||
} // evaluate
|
||||
|
||||
nsresult txKeyFunctionCall::getNameAtom(txAtom** aAtom)
|
||||
nsresult txKeyFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||
{
|
||||
*aAtom = txXSLTAtoms::key;
|
||||
TX_ADDREF_ATOM(*aAtom);
|
||||
|
|
|
@ -216,7 +216,7 @@ void txHTMLOutput::attribute(const nsAString& aName,
|
|||
localPart.Equals(aValue, txCaseInsensitiveStringComparator())) {
|
||||
txListIterator iter(&mAttributes);
|
||||
txAttribute* setAtt = 0;
|
||||
txAtom* localName = TX_GET_ATOM(localPart);
|
||||
nsIAtom* localName = TX_GET_ATOM(localPart);
|
||||
txExpandedName att(aNsID, localName);
|
||||
while ((setAtt = (txAttribute*)iter.next())) {
|
||||
if (setAtt->mName == att) {
|
||||
|
@ -304,7 +304,7 @@ void txHTMLOutput::startElement(const nsAString& aName,
|
|||
{
|
||||
txXMLOutput::startElement(aName, aNsID);
|
||||
|
||||
txAtom* localAtom;
|
||||
nsIAtom* localAtom;
|
||||
if (aNsID == kNameSpaceID_None) {
|
||||
nsAutoString localName;
|
||||
TX_ToLowerCase(aName, localName);
|
||||
|
|
|
@ -262,7 +262,7 @@ nsresult txPatternParser::createKeyPattern(ExprLexer& aLexer,
|
|||
|
||||
if (!XMLUtils::isValidQName(key))
|
||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||
txAtom *prefix = 0, *localName = 0;
|
||||
nsIAtom *prefix = 0, *localName = 0;
|
||||
PRInt32 namespaceID;
|
||||
nsresult rv = resolveQName(key, prefix, aContext, localName, namespaceID);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -302,7 +302,7 @@ nsresult txPatternParser::createStepPattern(ExprLexer& aLexer,
|
|||
txNodeTest* nodeTest = 0;
|
||||
if (tok->type == Token::CNAME) {
|
||||
// resolve QName
|
||||
txAtom *prefix, *lName;
|
||||
nsIAtom *prefix, *lName;
|
||||
PRInt32 nspace;
|
||||
rv = resolveQName(tok->value, prefix, aContext, lName, nspace);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
const int txXMLOutput::DEFAULT_INDENT = 2;
|
||||
|
||||
txAttribute::txAttribute(PRInt32 aNsID, txAtom* aLocalName,
|
||||
txAttribute::txAttribute(PRInt32 aNsID, nsIAtom* aLocalName,
|
||||
const nsAString& aValue) :
|
||||
mName(aNsID, aLocalName),
|
||||
mValue(aValue),
|
||||
|
@ -246,7 +246,7 @@ void txXMLOutput::startElement(const nsAString& aName,
|
|||
mCDATASections.push((void*)mInCDATASection);
|
||||
mInCDATASection = MB_FALSE;
|
||||
|
||||
txAtom* localName = TX_GET_ATOM(aName);
|
||||
nsIAtom* localName = TX_GET_ATOM(aName);
|
||||
txExpandedName currentElement(aNsID, localName);
|
||||
TX_IF_RELEASE_ATOM(localName);
|
||||
txListIterator iter(&(mOutputFormat.mCDATASectionElements));
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
class txAttribute {
|
||||
public:
|
||||
txAttribute(PRInt32 aNsID, txAtom* aLocalName, const nsAString& aValue);
|
||||
txAttribute(PRInt32 aNsID, nsIAtom* aLocalName, const nsAString& aValue);
|
||||
txExpandedName mName;
|
||||
nsString mValue;
|
||||
MBool mShorthand;
|
||||
|
|
|
@ -150,7 +150,7 @@ nsresult txXSLTNumber::getValueList(Element* aNumberElement,
|
|||
switch (currNode->getNodeType()) {
|
||||
case Node::ELEMENT_NODE:
|
||||
{
|
||||
txAtom* localName = 0;
|
||||
nsIAtom* localName = 0;
|
||||
currNode->getLocalName(&localName);
|
||||
nodeTest = new txNameTest(0, localName,
|
||||
currNode->getNamespaceID(),
|
||||
|
@ -218,7 +218,7 @@ nsresult txXSLTNumber::getValueList(Element* aNumberElement,
|
|||
// Generate list of values depending on the value of the level-attribute
|
||||
|
||||
nsAutoString levelStr;
|
||||
txAtom* level = 0;
|
||||
nsIAtom* level = 0;
|
||||
if (aNumberElement->getAttr(txXSLTAtoms::level, kNameSpaceID_None, levelStr)) {
|
||||
level = TX_GET_ATOM(levelStr);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ private:
|
|||
class txKeyPattern : public txPattern
|
||||
{
|
||||
public:
|
||||
txKeyPattern(ProcessorState* aPs, txAtom* aPrefix, txAtom* aLocalName,
|
||||
txKeyPattern(ProcessorState* aPs, nsIAtom* aPrefix, nsIAtom* aLocalName,
|
||||
PRInt32 aNSID, const nsAString& aValue)
|
||||
: mProcessorState(aPs), mName(aNSID, aLocalName), mPrefix(aPrefix),
|
||||
mValue(aValue)
|
||||
|
@ -186,7 +186,7 @@ public:
|
|||
private:
|
||||
ProcessorState* mProcessorState;
|
||||
txExpandedName mName;
|
||||
txAtom* mPrefix;
|
||||
nsIAtom* mPrefix;
|
||||
nsString mValue;
|
||||
};
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ int txNodeSorter::compareNodes(SortableNode* aSNode1,
|
|||
}
|
||||
|
||||
MBool txNodeSorter::getAttrAsAVT(Element* aSortElement,
|
||||
txAtom* aAttrName,
|
||||
nsIAtom* aAttrName,
|
||||
nsAString& aResult)
|
||||
{
|
||||
aResult.Truncate();
|
||||
|
|
|
@ -85,7 +85,7 @@ private:
|
|||
NodeSet* aNodes);
|
||||
|
||||
MBool getAttrAsAVT(Element* aSortElement,
|
||||
txAtom* aAttrName,
|
||||
nsIAtom* aAttrName,
|
||||
nsAString& aResult);
|
||||
|
||||
txList mSortKeys;
|
||||
|
|
Загрузка…
Ссылка в новой задаче