зеркало из https://github.com/mozilla/gecko-dev.git
Bug 157142: get rid of txAtom typedef
r=Pike rs=peterv
This commit is contained in:
Родитель
f2500788d1
Коммит
06dc1cd8e8
|
@ -39,16 +39,16 @@
|
||||||
|
|
||||||
#include "txAtoms.h"
|
#include "txAtoms.h"
|
||||||
|
|
||||||
#define TX_ATOM(_name, _value) txAtom* txXMLAtoms::_name = 0
|
#define TX_ATOM(_name, _value) nsIAtom* txXMLAtoms::_name = 0
|
||||||
XML_ATOMS;
|
XML_ATOMS;
|
||||||
#undef TX_ATOM
|
#undef TX_ATOM
|
||||||
#define TX_ATOM(_name, _value) txAtom* txXPathAtoms::_name = 0
|
#define TX_ATOM(_name, _value) nsIAtom* txXPathAtoms::_name = 0
|
||||||
#include "txXPathAtomList.h"
|
#include "txXPathAtomList.h"
|
||||||
#undef TX_ATOM
|
#undef TX_ATOM
|
||||||
#define TX_ATOM(_name, _value) txAtom* txXSLTAtoms::_name = 0
|
#define TX_ATOM(_name, _value) nsIAtom* txXSLTAtoms::_name = 0
|
||||||
#include "txXSLTAtomList.h"
|
#include "txXSLTAtomList.h"
|
||||||
#undef TX_ATOM
|
#undef TX_ATOM
|
||||||
#define TX_ATOM(_name, _value) txAtom* txHTMLAtoms::_name = 0
|
#define TX_ATOM(_name, _value) nsIAtom* txHTMLAtoms::_name = 0
|
||||||
#include "txHTMLAtomList.h"
|
#include "txHTMLAtomList.h"
|
||||||
#undef TX_ATOM
|
#undef TX_ATOM
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ TX_ATOM(space, "space"); \
|
||||||
TX_ATOM(xml, "xml"); \
|
TX_ATOM(xml, "xml"); \
|
||||||
TX_ATOM(xmlns, "xmlns")
|
TX_ATOM(xmlns, "xmlns")
|
||||||
|
|
||||||
#define TX_ATOM(_name, _value) static txAtom* _name
|
#define TX_ATOM(_name, _value) static nsIAtom* _name
|
||||||
|
|
||||||
class txXMLAtoms
|
class txXMLAtoms
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,7 @@ public:
|
||||||
private:
|
private:
|
||||||
struct MapItem {
|
struct MapItem {
|
||||||
PRInt32 mNamespaceID;
|
PRInt32 mNamespaceID;
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
TxObject* mValue;
|
TxObject* mValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ Attr::Attr(const nsAString& name, Document* owner):
|
||||||
// namespace handling has to be handled late, the attribute must
|
// namespace handling has to be handled late, the attribute must
|
||||||
// be added to the tree to resolve the prefix, unless it's
|
// be added to the tree to resolve the prefix, unless it's
|
||||||
// xmlns or xml, try to do that here
|
// 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)
|
if (prefixAtom == txXMLAtoms::xmlns)
|
||||||
mNamespaceID = kNameSpaceID_XMLNS;
|
mNamespaceID = kNameSpaceID_XMLNS;
|
||||||
else if (prefixAtom == txXMLAtoms::xml)
|
else if (prefixAtom == txXMLAtoms::xml)
|
||||||
|
@ -104,7 +104,7 @@ Node* Attr::appendChild(Node* newChild)
|
||||||
//
|
//
|
||||||
//Return the attributes local (unprefixed) name atom.
|
//Return the attributes local (unprefixed) name atom.
|
||||||
//
|
//
|
||||||
MBool Attr::getLocalName(txAtom** aLocalName)
|
MBool Attr::getLocalName(nsIAtom** aLocalName)
|
||||||
{
|
{
|
||||||
if (!aLocalName)
|
if (!aLocalName)
|
||||||
return MB_FALSE;
|
return MB_FALSE;
|
||||||
|
@ -126,7 +126,7 @@ PRInt32 Attr::getNamespaceID()
|
||||||
mNamespaceID = kNameSpaceID_None;
|
mNamespaceID = kNameSpaceID_None;
|
||||||
PRInt32 idx = nodeName.FindChar(':');
|
PRInt32 idx = nodeName.FindChar(':');
|
||||||
if (idx != kNotFound) {
|
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);
|
mNamespaceID = lookupNamespaceID(prefixAtom);
|
||||||
}
|
}
|
||||||
return mNamespaceID;
|
return mNamespaceID;
|
||||||
|
|
|
@ -115,9 +115,9 @@ class Node : public TxObject
|
||||||
virtual nsresult getNamespaceURI(nsAString& aNSURI) = 0;
|
virtual nsresult getNamespaceURI(nsAString& aNSURI) = 0;
|
||||||
|
|
||||||
//txXPathNode functions
|
//txXPathNode functions
|
||||||
virtual MBool getLocalName(txAtom** aLocalName) = 0;
|
virtual MBool getLocalName(nsIAtom** aLocalName) = 0;
|
||||||
virtual PRInt32 getNamespaceID() = 0;
|
virtual PRInt32 getNamespaceID() = 0;
|
||||||
virtual PRInt32 lookupNamespaceID(txAtom* aPrefix) = 0;
|
virtual PRInt32 lookupNamespaceID(nsIAtom* aPrefix) = 0;
|
||||||
virtual Node* getXPathParent() = 0;
|
virtual Node* getXPathParent() = 0;
|
||||||
virtual PRInt32 compareDocumentPosition(Node* aOther) = 0;
|
virtual PRInt32 compareDocumentPosition(Node* aOther) = 0;
|
||||||
};
|
};
|
||||||
|
@ -249,9 +249,9 @@ class NodeDefinition : public Node, public NodeList
|
||||||
nsresult getNamespaceURI(nsAString& aNSURI);
|
nsresult getNamespaceURI(nsAString& aNSURI);
|
||||||
|
|
||||||
//txXPathNode functions
|
//txXPathNode functions
|
||||||
virtual MBool getLocalName(txAtom** aLocalName);
|
virtual MBool getLocalName(nsIAtom** aLocalName);
|
||||||
virtual PRInt32 getNamespaceID();
|
virtual PRInt32 getNamespaceID();
|
||||||
virtual PRInt32 lookupNamespaceID(txAtom*);
|
virtual PRInt32 lookupNamespaceID(nsIAtom*);
|
||||||
virtual Node* getXPathParent();
|
virtual Node* getXPathParent();
|
||||||
virtual PRInt32 compareDocumentPosition(Node* aOther);
|
virtual PRInt32 compareDocumentPosition(Node* aOther);
|
||||||
|
|
||||||
|
@ -419,10 +419,10 @@ class Element : public NodeDefinition
|
||||||
Node* appendChild(Node* newChild);
|
Node* appendChild(Node* newChild);
|
||||||
|
|
||||||
//txXPathNode functions override
|
//txXPathNode functions override
|
||||||
MBool getLocalName(txAtom** aLocalName);
|
MBool getLocalName(nsIAtom** aLocalName);
|
||||||
PRInt32 getNamespaceID();
|
PRInt32 getNamespaceID();
|
||||||
MBool getAttr(txAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
MBool getAttr(nsIAtom* aLocalName, PRInt32 aNSID, nsAString& aValue);
|
||||||
MBool hasAttr(txAtom* aLocalName, PRInt32 aNSID);
|
MBool hasAttr(nsIAtom* aLocalName, PRInt32 aNSID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Document;
|
friend class Document;
|
||||||
|
@ -431,7 +431,7 @@ class Element : public NodeDefinition
|
||||||
Document* aOwner);
|
Document* aOwner);
|
||||||
|
|
||||||
AttrMap mAttributes;
|
AttrMap mAttributes;
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
PRInt32 mNamespaceID;
|
PRInt32 mNamespaceID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ class Attr : public NodeDefinition
|
||||||
Node* appendChild(Node* newChild);
|
Node* appendChild(Node* newChild);
|
||||||
|
|
||||||
//txXPathNode functions override
|
//txXPathNode functions override
|
||||||
MBool getLocalName(txAtom** aLocalName);
|
MBool getLocalName(nsIAtom** aLocalName);
|
||||||
PRInt32 getNamespaceID();
|
PRInt32 getNamespaceID();
|
||||||
Node* getXPathParent();
|
Node* getXPathParent();
|
||||||
|
|
||||||
|
@ -470,7 +470,7 @@ class Attr : public NodeDefinition
|
||||||
|
|
||||||
Element* ownerElement;
|
Element* ownerElement;
|
||||||
|
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
PRInt32 mNamespaceID;
|
PRInt32 mNamespaceID;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -488,14 +488,14 @@ class ProcessingInstruction : public NodeDefinition
|
||||||
~ProcessingInstruction();
|
~ProcessingInstruction();
|
||||||
|
|
||||||
//txXPathNode functions override
|
//txXPathNode functions override
|
||||||
MBool getLocalName(txAtom** aLocalName);
|
MBool getLocalName(nsIAtom** aLocalName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class Document;
|
friend class Document;
|
||||||
ProcessingInstruction(const nsAString& theTarget, const nsAString& theData,
|
ProcessingInstruction(const nsAString& theTarget, const nsAString& theData,
|
||||||
Document* owner);
|
Document* owner);
|
||||||
|
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
};
|
};
|
||||||
|
|
||||||
class txNamespaceManager
|
class txNamespaceManager
|
||||||
|
|
|
@ -99,7 +99,7 @@ Node* Element::appendChild(Node* newChild)
|
||||||
//
|
//
|
||||||
//Return the elements local (unprefixed) name.
|
//Return the elements local (unprefixed) name.
|
||||||
//
|
//
|
||||||
MBool Element::getLocalName(txAtom** aLocalName)
|
MBool Element::getLocalName(nsIAtom** aLocalName)
|
||||||
{
|
{
|
||||||
if (!aLocalName)
|
if (!aLocalName)
|
||||||
return MB_FALSE;
|
return MB_FALSE;
|
||||||
|
@ -182,7 +182,7 @@ void Element::setAttributeNS(const nsAString& aNamespaceURI,
|
||||||
AttrMap::ListItem* item = mAttributes.firstItem;
|
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||||
while (item) {
|
while (item) {
|
||||||
foundNode = (Attr*)item->node;
|
foundNode = (Attr*)item->node;
|
||||||
txAtom* attrName;
|
nsIAtom* attrName;
|
||||||
if (foundNode->getLocalName(&attrName) &&
|
if (foundNode->getLocalName(&attrName) &&
|
||||||
namespaceID == foundNode->getNamespaceID() &&
|
namespaceID == foundNode->getNamespaceID() &&
|
||||||
localName == attrName) {
|
localName == attrName) {
|
||||||
|
@ -219,14 +219,14 @@ Attr* Element::getAttributeNode(const nsAString& name)
|
||||||
// exists, and sets aValue to the value of the attribute.
|
// exists, and sets aValue to the value of the attribute.
|
||||||
// Return false, if the attribute does not exist.
|
// Return false, if the attribute does not exist.
|
||||||
//
|
//
|
||||||
MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
MBool Element::getAttr(nsIAtom* aLocalName, PRInt32 aNSID,
|
||||||
nsAString& aValue)
|
nsAString& aValue)
|
||||||
{
|
{
|
||||||
aValue.Truncate();
|
aValue.Truncate();
|
||||||
AttrMap::ListItem* item = mAttributes.firstItem;
|
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||||
while (item) {
|
while (item) {
|
||||||
Attr* attrNode = (Attr*)item->node;
|
Attr* attrNode = (Attr*)item->node;
|
||||||
txAtom* localName;
|
nsIAtom* localName;
|
||||||
if (attrNode->getLocalName(&localName) &&
|
if (attrNode->getLocalName(&localName) &&
|
||||||
aNSID == attrNode->getNamespaceID() &&
|
aNSID == attrNode->getNamespaceID() &&
|
||||||
aLocalName == localName) {
|
aLocalName == localName) {
|
||||||
|
@ -244,12 +244,12 @@ MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
||||||
// Return true if the attribute specified by localname and nsID
|
// Return true if the attribute specified by localname and nsID
|
||||||
// exists. Return false otherwise.
|
// exists. Return false otherwise.
|
||||||
//
|
//
|
||||||
MBool Element::hasAttr(txAtom* aLocalName, PRInt32 aNSID)
|
MBool Element::hasAttr(nsIAtom* aLocalName, PRInt32 aNSID)
|
||||||
{
|
{
|
||||||
AttrMap::ListItem* item = mAttributes.firstItem;
|
AttrMap::ListItem* item = mAttributes.firstItem;
|
||||||
while (item) {
|
while (item) {
|
||||||
Attr* attrNode = (Attr*)item->node;
|
Attr* attrNode = (Attr*)item->node;
|
||||||
txAtom* localName;
|
nsIAtom* localName;
|
||||||
if (attrNode->getLocalName(&localName) &&
|
if (attrNode->getLocalName(&localName) &&
|
||||||
aNSID == attrNode->getNamespaceID() &&
|
aNSID == attrNode->getNamespaceID() &&
|
||||||
aLocalName == localName) {
|
aLocalName == localName) {
|
||||||
|
|
|
@ -266,7 +266,7 @@ MBool NodeDefinition::hasChildNodes() const
|
||||||
return MB_FALSE;
|
return MB_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MBool NodeDefinition::getLocalName(txAtom** aLocalName)
|
MBool NodeDefinition::getLocalName(nsIAtom** aLocalName)
|
||||||
{
|
{
|
||||||
if (!aLocalName)
|
if (!aLocalName)
|
||||||
return MB_FALSE;
|
return MB_FALSE;
|
||||||
|
@ -290,7 +290,7 @@ PRInt32 NodeDefinition::getNamespaceID()
|
||||||
//
|
//
|
||||||
// @return namespace associated with prefix
|
// @return namespace associated with prefix
|
||||||
//
|
//
|
||||||
PRInt32 NodeDefinition::lookupNamespaceID(txAtom* aPrefix)
|
PRInt32 NodeDefinition::lookupNamespaceID(nsIAtom* aPrefix)
|
||||||
{
|
{
|
||||||
// this is http://www.w3.org/2000/xmlns/,
|
// this is http://www.w3.org/2000/xmlns/,
|
||||||
// ID = kNameSpaceID_XMLNS, see txNamespaceManager::Init
|
// ID = kNameSpaceID_XMLNS, see txNamespaceManager::Init
|
||||||
|
|
|
@ -57,7 +57,7 @@ ProcessingInstruction::~ProcessingInstruction()
|
||||||
//from all child manipulation functions.
|
//from all child manipulation functions.
|
||||||
//
|
//
|
||||||
|
|
||||||
MBool ProcessingInstruction::getLocalName(txAtom** aLocalName)
|
MBool ProcessingInstruction::getLocalName(nsIAtom** aLocalName)
|
||||||
{
|
{
|
||||||
if (!aLocalName)
|
if (!aLocalName)
|
||||||
return MB_FALSE;
|
return MB_FALSE;
|
||||||
|
|
|
@ -210,7 +210,7 @@ MBool XMLUtils::getXMLSpacePreserve(Node* aNode)
|
||||||
if (parent->getNodeType() == Node::ELEMENT_NODE) {
|
if (parent->getNodeType() == Node::ELEMENT_NODE) {
|
||||||
Element* elem = (Element*)parent;
|
Element* elem = (Element*)parent;
|
||||||
if (elem->getAttr(txXMLAtoms::space, kNameSpaceID_XML, value)) {
|
if (elem->getAttr(txXMLAtoms::space, kNameSpaceID_XML, value)) {
|
||||||
txAtom* val = TX_GET_ATOM(value);
|
nsIAtom* val = TX_GET_ATOM(value);
|
||||||
if (val == txXMLAtoms::preserve) {
|
if (val == txXMLAtoms::preserve) {
|
||||||
TX_IF_RELEASE_ATOM(val);
|
TX_IF_RELEASE_ATOM(val);
|
||||||
return MB_TRUE;
|
return MB_TRUE;
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
txExpandedName(PRInt32 aNsID,
|
txExpandedName(PRInt32 aNsID,
|
||||||
txAtom* aLocalName) : mNamespaceID(aNsID),
|
nsIAtom* aLocalName) : mNamespaceID(aNsID),
|
||||||
mLocalName(aLocalName)
|
mLocalName(aLocalName)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -87,9 +87,9 @@ class XMLUtils {
|
||||||
|
|
||||||
public:
|
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 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
|
* Returns true if the given string is a valid XML QName
|
||||||
|
|
|
@ -129,7 +129,7 @@ nsXPathEvaluator::Evaluate(const nsAString & aExpression,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nsresult nsXPathEvaluator::ParseContextImpl::resolveNamespacePrefix
|
nsresult nsXPathEvaluator::ParseContextImpl::resolveNamespacePrefix
|
||||||
(txAtom* aPrefix, PRInt32& aID)
|
(nsIAtom* aPrefix, PRInt32& aID)
|
||||||
{
|
{
|
||||||
nsAutoString prefix;
|
nsAutoString prefix;
|
||||||
if (aPrefix) {
|
if (aPrefix) {
|
||||||
|
@ -155,7 +155,7 @@ nsresult nsXPathEvaluator::ParseContextImpl::resolveNamespacePrefix
|
||||||
return gTxNameSpaceManager->RegisterNameSpace(ns, aID);
|
return gTxNameSpaceManager->RegisterNameSpace(ns, aID);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsXPathEvaluator::ParseContextImpl::resolveFunctionCall(txAtom* aName,
|
nsresult nsXPathEvaluator::ParseContextImpl::resolveFunctionCall(nsIAtom* aName,
|
||||||
PRInt32 aID,
|
PRInt32 aID,
|
||||||
FunctionCall*& aFn)
|
FunctionCall*& aFn)
|
||||||
{
|
{
|
||||||
|
|
|
@ -77,8 +77,8 @@ private:
|
||||||
return mLastError;
|
return mLastError;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult resolveNamespacePrefix(txAtom* aPrefix, PRInt32& aID);
|
nsresult resolveNamespacePrefix(nsIAtom* aPrefix, PRInt32& aID);
|
||||||
nsresult resolveFunctionCall(txAtom* aName, PRInt32 aID,
|
nsresult resolveFunctionCall(nsIAtom* aName, PRInt32 aID,
|
||||||
FunctionCall*& aFunction);
|
FunctionCall*& aFunction);
|
||||||
void receiveError(const nsAString& aMsg, nsresult aRes);
|
void receiveError(const nsAString& aMsg, nsresult aRes);
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ nsXPathExpression::Evaluate(nsIDOMNode *aContextNode,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
nsresult nsXPathExpression::EvalContextImpl::getVariable(PRInt32 aNamespace,
|
nsresult nsXPathExpression::EvalContextImpl::getVariable(PRInt32 aNamespace,
|
||||||
txAtom* aLName,
|
nsIAtom* aLName,
|
||||||
ExprResult*& aResult)
|
ExprResult*& aResult)
|
||||||
{
|
{
|
||||||
aResult = 0;
|
aResult = 0;
|
||||||
|
|
|
@ -120,7 +120,7 @@ ExprResult* BooleanFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new StringResult(NS_LITERAL_STRING("error"));
|
return new StringResult(NS_LITERAL_STRING("error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult BooleanFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult BooleanFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
switch (mType) {
|
switch (mType) {
|
||||||
case TX_BOOLEAN:
|
case TX_BOOLEAN:
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
|
|
||||||
#define TX_DECL_FUNCTION \
|
#define TX_DECL_FUNCTION \
|
||||||
TX_DECL_EVALUATE; \
|
TX_DECL_EVALUATE; \
|
||||||
nsresult getNameAtom(txAtom** aAtom)
|
nsresult getNameAtom(nsIAtom** aAtom)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class represents a FunctionCall as defined by the XPath 1.0
|
* 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.
|
* Returns the name of the function as an atom.
|
||||||
*/
|
*/
|
||||||
virtual nsresult getNameAtom(txAtom** aAtom) = 0;
|
virtual nsresult getNameAtom(nsIAtom** aAtom) = 0;
|
||||||
}; //-- FunctionCall
|
}; //-- FunctionCall
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ public:
|
||||||
* Creates a new txNameTest with the given type and the given
|
* Creates a new txNameTest with the given type and the given
|
||||||
* principal node type
|
* principal node type
|
||||||
*/
|
*/
|
||||||
txNameTest(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID,
|
txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
|
||||||
Node::NodeType aNodeType);
|
Node::NodeType aNodeType);
|
||||||
|
|
||||||
~txNameTest();
|
~txNameTest();
|
||||||
|
@ -232,8 +232,8 @@ public:
|
||||||
TX_DECL_NODE_TEST;
|
TX_DECL_NODE_TEST;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
txAtom* mPrefix;
|
nsIAtom* mPrefix;
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
PRInt32 mNamespace;
|
PRInt32 mNamespace;
|
||||||
Node::NodeType mNodeType;
|
Node::NodeType mNodeType;
|
||||||
};
|
};
|
||||||
|
@ -267,7 +267,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NodeType mNodeType;
|
NodeType mNodeType;
|
||||||
txAtom* mNodeName;
|
nsIAtom* mNodeName;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -554,14 +554,14 @@ class VariableRefExpr : public Expr {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
VariableRefExpr(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID);
|
VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID);
|
||||||
~VariableRefExpr();
|
~VariableRefExpr();
|
||||||
|
|
||||||
TX_DECL_EXPR;
|
TX_DECL_EXPR;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
txAtom* mPrefix;
|
nsIAtom* mPrefix;
|
||||||
txAtom* mLocalName;
|
nsIAtom* mLocalName;
|
||||||
PRInt32 mNamespace;
|
PRInt32 mNamespace;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -326,7 +326,7 @@ Expr* ExprParser::createFilterExpr(ExprLexer& lexer, txIParseContext* aContext)
|
||||||
break;
|
break;
|
||||||
case Token::VAR_REFERENCE :
|
case Token::VAR_REFERENCE :
|
||||||
{
|
{
|
||||||
txAtom *prefix, *lName;
|
nsIAtom *prefix, *lName;
|
||||||
PRInt32 nspace;
|
PRInt32 nspace;
|
||||||
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
||||||
lName, nspace);
|
lName, nspace);
|
||||||
|
@ -490,7 +490,7 @@ Expr* ExprParser::createFunctionCall(ExprLexer& lexer,
|
||||||
fnCall = new NumberFunctionCall(NumberFunctionCall::FLOOR);
|
fnCall = new NumberFunctionCall(NumberFunctionCall::FLOOR);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
txAtom *prefix, *lName;
|
nsIAtom *prefix, *lName;
|
||||||
PRInt32 namespaceID;
|
PRInt32 namespaceID;
|
||||||
rv = resolveQName(tok->value, prefix, aContext, lName, namespaceID);
|
rv = resolveQName(tok->value, prefix, aContext, lName, namespaceID);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
@ -640,7 +640,7 @@ LocationStep* ExprParser::createLocationStep(ExprLexer& lexer,
|
||||||
case Token::CNAME :
|
case Token::CNAME :
|
||||||
{
|
{
|
||||||
// resolve QName
|
// resolve QName
|
||||||
txAtom *prefix, *lName;
|
nsIAtom *prefix, *lName;
|
||||||
PRInt32 nspace;
|
PRInt32 nspace;
|
||||||
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
nsresult rv = resolveQName(tok->value, prefix, aContext,
|
||||||
lName, nspace);
|
lName, nspace);
|
||||||
|
@ -1013,8 +1013,8 @@ short ExprParser::precedenceLevel(short tokenType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult ExprParser::resolveQName(const nsAString& aQName,
|
nsresult ExprParser::resolveQName(const nsAString& aQName,
|
||||||
txAtom*& aPrefix, txIParseContext* aContext,
|
nsIAtom*& aPrefix, txIParseContext* aContext,
|
||||||
txAtom*& aLocalName, PRInt32& aNamespace)
|
nsIAtom*& aLocalName, PRInt32& aNamespace)
|
||||||
{
|
{
|
||||||
aNamespace = kNameSpaceID_None;
|
aNamespace = kNameSpaceID_None;
|
||||||
PRInt32 idx = aQName.FindChar(':');
|
PRInt32 idx = aQName.FindChar(':');
|
||||||
|
|
|
@ -82,9 +82,9 @@ protected:
|
||||||
* Resolve a QName, given the mContext parse context.
|
* Resolve a QName, given the mContext parse context.
|
||||||
* Returns prefix and localName as well as namespace ID
|
* 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,
|
txIParseContext* aContext,
|
||||||
txAtom*& aLocalName, PRInt32& aNamespace);
|
nsIAtom*& aLocalName, PRInt32& aNamespace);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Using the given lexer, parses the tokens if they represent a
|
* Using the given lexer, parses the tokens if they represent a
|
||||||
|
|
|
@ -56,7 +56,7 @@ PRUint32 txForwardContext::position()
|
||||||
return (PRUint32)(pos+1);
|
return (PRUint32)(pos+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult txForwardContext::getVariable(PRInt32 aNamespace, txAtom* aLName,
|
nsresult txForwardContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||||
ExprResult*& aResult)
|
ExprResult*& aResult)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||||
|
|
|
@ -176,7 +176,7 @@ MBool FunctionCall::requireParams(int paramCountMin, txIEvalContext* aContext)
|
||||||
**/
|
**/
|
||||||
void FunctionCall::toString(nsAString& aDest)
|
void FunctionCall::toString(nsAString& aDest)
|
||||||
{
|
{
|
||||||
txAtom* functionNameAtom = 0;
|
nsIAtom* functionNameAtom = 0;
|
||||||
nsAutoString functionName;
|
nsAutoString functionName;
|
||||||
if (!NS_SUCCEEDED(getNameAtom(&functionNameAtom)) ||
|
if (!NS_SUCCEEDED(getNameAtom(&functionNameAtom)) ||
|
||||||
!TX_GET_ATOM_STRING(functionNameAtom, functionName)) {
|
!TX_GET_ATOM_STRING(functionNameAtom, functionName)) {
|
||||||
|
|
|
@ -66,13 +66,13 @@ public:
|
||||||
/*
|
/*
|
||||||
* Return a namespaceID for a given prefix.
|
* 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
|
* Create a FunctionCall, needed for extension function calls and
|
||||||
* XSLT. XPath function calls are resolved by the Parser.
|
* 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;
|
FunctionCall*& aFunction) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -101,7 +101,7 @@ public:
|
||||||
* Return the ExprResult associated with the variable with the
|
* Return the ExprResult associated with the variable with the
|
||||||
* given namespace and local name.
|
* given namespace and local name.
|
||||||
*/
|
*/
|
||||||
virtual nsresult getVariable(PRInt32 aNamespace, txAtom* aLName,
|
virtual nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||||
ExprResult*& aResult) = 0;
|
ExprResult*& aResult) = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -117,7 +117,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TX_DECL_MATCH_CONTEXT \
|
#define TX_DECL_MATCH_CONTEXT \
|
||||||
nsresult getVariable(PRInt32 aNamespace, txAtom* aLName, \
|
nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName, \
|
||||||
ExprResult*& aResult); \
|
ExprResult*& aResult); \
|
||||||
MBool isStripSpaceAllowed(Node* aNode); \
|
MBool isStripSpaceAllowed(Node* aNode); \
|
||||||
void receiveError(const nsAString& aMsg, nsresult aRes)
|
void receiveError(const nsAString& aMsg, nsresult aRes)
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
#include "txAtoms.h"
|
#include "txAtoms.h"
|
||||||
#include "txIXPathContext.h"
|
#include "txIXPathContext.h"
|
||||||
|
|
||||||
txNameTest::txNameTest(txAtom* aPrefix, txAtom* aLocalName, PRInt32 aNSID,
|
txNameTest::txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, PRInt32 aNSID,
|
||||||
Node::NodeType aNodeType)
|
Node::NodeType aNodeType)
|
||||||
:mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID),
|
:mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID),
|
||||||
mNodeType(aNodeType)
|
mNodeType(aNodeType)
|
||||||
|
@ -66,7 +66,7 @@ MBool txNameTest::matches(Node* aNode, txIMatchContext* aContext)
|
||||||
return MB_TRUE;
|
return MB_TRUE;
|
||||||
|
|
||||||
// Compare local-names
|
// Compare local-names
|
||||||
txAtom* localName;
|
nsIAtom* localName;
|
||||||
aNode->getLocalName(&localName);
|
aNode->getLocalName(&localName);
|
||||||
MBool result = localName == mLocalName;
|
MBool result = localName == mLocalName;
|
||||||
TX_IF_RELEASE_ATOM(localName);
|
TX_IF_RELEASE_ATOM(localName);
|
||||||
|
|
|
@ -55,7 +55,7 @@ PRUint32 txNodeSetContext::position()
|
||||||
return mPosition;
|
return mPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult txNodeSetContext::getVariable(PRInt32 aNamespace, txAtom* aLName,
|
nsresult txNodeSetContext::getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||||
ExprResult*& aResult)
|
ExprResult*& aResult)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||||
|
|
|
@ -161,7 +161,7 @@ ExprResult* NodeSetFunctionCall::evaluate(txIEvalContext* aContext) {
|
||||||
case LOCAL_NAME:
|
case LOCAL_NAME:
|
||||||
{
|
{
|
||||||
nsAutoString localName;
|
nsAutoString localName;
|
||||||
txAtom* localNameAtom;
|
nsIAtom* localNameAtom;
|
||||||
node->getLocalName(&localNameAtom);
|
node->getLocalName(&localNameAtom);
|
||||||
if (localNameAtom) {
|
if (localNameAtom) {
|
||||||
// Node has a localName
|
// Node has a localName
|
||||||
|
@ -220,7 +220,7 @@ ExprResult* NodeSetFunctionCall::evaluate(txIEvalContext* aContext) {
|
||||||
return new StringResult(NS_LITERAL_STRING("error"));
|
return new StringResult(NS_LITERAL_STRING("error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult NodeSetFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult NodeSetFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
switch (mType) {
|
switch (mType) {
|
||||||
case COUNT:
|
case COUNT:
|
||||||
|
|
|
@ -64,7 +64,7 @@ MBool txNodeTypeTest::matches(Node* aNode, txIMatchContext* aContext)
|
||||||
!aContext->isStripSpaceAllowed(aNode);
|
!aContext->isStripSpaceAllowed(aNode);
|
||||||
case PI_TYPE:
|
case PI_TYPE:
|
||||||
if (type == Node::PROCESSING_INSTRUCTION_NODE) {
|
if (type == Node::PROCESSING_INSTRUCTION_NODE) {
|
||||||
txAtom* localName = 0;
|
nsIAtom* localName = 0;
|
||||||
MBool result;
|
MBool result;
|
||||||
result = !mNodeName ||
|
result = !mNodeName ||
|
||||||
(aNode->getLocalName(&localName) &&
|
(aNode->getLocalName(&localName) &&
|
||||||
|
|
|
@ -138,7 +138,7 @@ ExprResult* NumberFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new StringResult(NS_LITERAL_STRING("error"));
|
return new StringResult(NS_LITERAL_STRING("error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult NumberFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult NumberFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
switch (mType) {
|
switch (mType) {
|
||||||
case NUMBER:
|
case NUMBER:
|
||||||
|
|
|
@ -53,7 +53,7 @@ public:
|
||||||
~txSingleNodeContext()
|
~txSingleNodeContext()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
nsresult getVariable(PRInt32 aNamespace, txAtom* aLName,
|
nsresult getVariable(PRInt32 aNamespace, nsIAtom* aLName,
|
||||||
ExprResult*& aResult)
|
ExprResult*& aResult)
|
||||||
{
|
{
|
||||||
NS_ASSERTION(mInner, "mInner is null!!!");
|
NS_ASSERTION(mInner, "mInner is null!!!");
|
||||||
|
|
|
@ -251,7 +251,7 @@ ExprResult* StringFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new StringResult(NS_LITERAL_STRING("error"));
|
return new StringResult(NS_LITERAL_STRING("error"));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult StringFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult StringFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
switch (mType) {
|
switch (mType) {
|
||||||
case CONCAT:
|
case CONCAT:
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
/**
|
/**
|
||||||
* Creates a VariableRefExpr with the given variable name
|
* Creates a VariableRefExpr with the given variable name
|
||||||
**/
|
**/
|
||||||
VariableRefExpr::VariableRefExpr(txAtom* aPrefix, txAtom* aLocalName,
|
VariableRefExpr::VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName,
|
||||||
PRInt32 aNSID)
|
PRInt32 aNSID)
|
||||||
: mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID)
|
: mPrefix(aPrefix), mLocalName(aLocalName), mNamespace(aNSID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,7 @@ ExprResult* CurrentFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new NodeSet(mPs->getEvalContext()->getContextNode());
|
return new NodeSet(mPs->getEvalContext()->getContextNode());
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult CurrentFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult CurrentFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::current;
|
*aAtom = txXSLTAtoms::current;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -128,7 +128,7 @@ ExprResult* DocumentFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return nodeSet;
|
return nodeSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult DocumentFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult DocumentFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::document;
|
*aAtom = txXSLTAtoms::document;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -133,7 +133,7 @@ ExprResult* ElementAvailableFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult ElementAvailableFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult ElementAvailableFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::elementAvailable;
|
*aAtom = txXSLTAtoms::elementAvailable;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -476,7 +476,7 @@ ExprResult* txFormatNumberFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new StringResult(res);
|
return new StringResult(res);
|
||||||
} //-- evaluate
|
} //-- evaluate
|
||||||
|
|
||||||
nsresult txFormatNumberFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult txFormatNumberFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::formatNumber;
|
*aAtom = txXSLTAtoms::formatNumber;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -132,7 +132,7 @@ ExprResult* FunctionAvailableFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult FunctionAvailableFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult FunctionAvailableFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::functionAvailable;
|
*aAtom = txXSLTAtoms::functionAvailable;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -101,7 +101,7 @@ ExprResult* GenerateIdFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return new StringResult(NS_ConvertASCIItoUCS2(buf));
|
return new StringResult(NS_ConvertASCIItoUCS2(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult GenerateIdFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult GenerateIdFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::generateId;
|
*aAtom = txXSLTAtoms::generateId;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -216,7 +216,7 @@ void txHTMLOutput::attribute(const nsAString& aName,
|
||||||
localPart.Equals(aValue, txCaseInsensitiveStringComparator())) {
|
localPart.Equals(aValue, txCaseInsensitiveStringComparator())) {
|
||||||
txListIterator iter(&mAttributes);
|
txListIterator iter(&mAttributes);
|
||||||
txAttribute* setAtt = 0;
|
txAttribute* setAtt = 0;
|
||||||
txAtom* localName = TX_GET_ATOM(localPart);
|
nsIAtom* localName = TX_GET_ATOM(localPart);
|
||||||
txExpandedName att(aNsID, localName);
|
txExpandedName att(aNsID, localName);
|
||||||
while ((setAtt = (txAttribute*)iter.next())) {
|
while ((setAtt = (txAttribute*)iter.next())) {
|
||||||
if (setAtt->mName == att) {
|
if (setAtt->mName == att) {
|
||||||
|
@ -304,7 +304,7 @@ void txHTMLOutput::startElement(const nsAString& aName,
|
||||||
{
|
{
|
||||||
txXMLOutput::startElement(aName, aNsID);
|
txXMLOutput::startElement(aName, aNsID);
|
||||||
|
|
||||||
txAtom* localAtom;
|
nsIAtom* localAtom;
|
||||||
if (aNsID == kNameSpaceID_None) {
|
if (aNsID == kNameSpaceID_None) {
|
||||||
nsAutoString localName;
|
nsAutoString localName;
|
||||||
TX_ToLowerCase(aName, localName);
|
TX_ToLowerCase(aName, localName);
|
||||||
|
|
|
@ -106,7 +106,7 @@ ExprResult* txKeyFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
|
|
||||||
} // evaluate
|
} // evaluate
|
||||||
|
|
||||||
nsresult txKeyFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult txKeyFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::key;
|
*aAtom = txXSLTAtoms::key;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -264,7 +264,7 @@ int txNodeSorter::compareNodes(SortableNode* aSNode1,
|
||||||
}
|
}
|
||||||
|
|
||||||
MBool txNodeSorter::getAttrAsAVT(Element* aSortElement,
|
MBool txNodeSorter::getAttrAsAVT(Element* aSortElement,
|
||||||
txAtom* aAttrName,
|
nsIAtom* aAttrName,
|
||||||
nsAString& aResult)
|
nsAString& aResult)
|
||||||
{
|
{
|
||||||
aResult.Truncate();
|
aResult.Truncate();
|
||||||
|
|
|
@ -85,7 +85,7 @@ private:
|
||||||
NodeSet* aNodes);
|
NodeSet* aNodes);
|
||||||
|
|
||||||
MBool getAttrAsAVT(Element* aSortElement,
|
MBool getAttrAsAVT(Element* aSortElement,
|
||||||
txAtom* aAttrName,
|
nsIAtom* aAttrName,
|
||||||
nsAString& aResult);
|
nsAString& aResult);
|
||||||
|
|
||||||
txList mSortKeys;
|
txList mSortKeys;
|
||||||
|
|
|
@ -262,7 +262,7 @@ nsresult txPatternParser::createKeyPattern(ExprLexer& aLexer,
|
||||||
|
|
||||||
if (!XMLUtils::isValidQName(key))
|
if (!XMLUtils::isValidQName(key))
|
||||||
return NS_ERROR_XPATH_PARSE_FAILED;
|
return NS_ERROR_XPATH_PARSE_FAILED;
|
||||||
txAtom *prefix = 0, *localName = 0;
|
nsIAtom *prefix = 0, *localName = 0;
|
||||||
PRInt32 namespaceID;
|
PRInt32 namespaceID;
|
||||||
nsresult rv = resolveQName(key, prefix, aContext, localName, namespaceID);
|
nsresult rv = resolveQName(key, prefix, aContext, localName, namespaceID);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
|
@ -302,7 +302,7 @@ nsresult txPatternParser::createStepPattern(ExprLexer& aLexer,
|
||||||
txNodeTest* nodeTest = 0;
|
txNodeTest* nodeTest = 0;
|
||||||
if (tok->type == Token::CNAME) {
|
if (tok->type == Token::CNAME) {
|
||||||
// resolve QName
|
// resolve QName
|
||||||
txAtom *prefix, *lName;
|
nsIAtom *prefix, *lName;
|
||||||
PRInt32 nspace;
|
PRInt32 nspace;
|
||||||
rv = resolveQName(tok->value, prefix, aContext, lName, nspace);
|
rv = resolveQName(tok->value, prefix, aContext, lName, nspace);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
|
@ -64,7 +64,7 @@ ExprResult* SystemPropertyFunctionCall::evaluate(txIEvalContext* aContext)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult SystemPropertyFunctionCall::getNameAtom(txAtom** aAtom)
|
nsresult SystemPropertyFunctionCall::getNameAtom(nsIAtom** aAtom)
|
||||||
{
|
{
|
||||||
*aAtom = txXSLTAtoms::systemProperty;
|
*aAtom = txXSLTAtoms::systemProperty;
|
||||||
TX_ADDREF_ATOM(*aAtom);
|
TX_ADDREF_ATOM(*aAtom);
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
const int txXMLOutput::DEFAULT_INDENT = 2;
|
const int txXMLOutput::DEFAULT_INDENT = 2;
|
||||||
|
|
||||||
txAttribute::txAttribute(PRInt32 aNsID, txAtom* aLocalName,
|
txAttribute::txAttribute(PRInt32 aNsID, nsIAtom* aLocalName,
|
||||||
const nsAString& aValue) :
|
const nsAString& aValue) :
|
||||||
mName(aNsID, aLocalName),
|
mName(aNsID, aLocalName),
|
||||||
mValue(aValue),
|
mValue(aValue),
|
||||||
|
@ -246,7 +246,7 @@ void txXMLOutput::startElement(const nsAString& aName,
|
||||||
mCDATASections.push((void*)mInCDATASection);
|
mCDATASections.push((void*)mInCDATASection);
|
||||||
mInCDATASection = MB_FALSE;
|
mInCDATASection = MB_FALSE;
|
||||||
|
|
||||||
txAtom* localName = TX_GET_ATOM(aName);
|
nsIAtom* localName = TX_GET_ATOM(aName);
|
||||||
txExpandedName currentElement(aNsID, localName);
|
txExpandedName currentElement(aNsID, localName);
|
||||||
TX_IF_RELEASE_ATOM(localName);
|
TX_IF_RELEASE_ATOM(localName);
|
||||||
txListIterator iter(&(mOutputFormat.mCDATASectionElements));
|
txListIterator iter(&(mOutputFormat.mCDATASectionElements));
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
|
|
||||||
class txAttribute {
|
class txAttribute {
|
||||||
public:
|
public:
|
||||||
txAttribute(PRInt32 aNsID, txAtom* aLocalName, const nsAString& aValue);
|
txAttribute(PRInt32 aNsID, nsIAtom* aLocalName, const nsAString& aValue);
|
||||||
txExpandedName mName;
|
txExpandedName mName;
|
||||||
nsString mValue;
|
nsString mValue;
|
||||||
MBool mShorthand;
|
MBool mShorthand;
|
||||||
|
|
|
@ -150,7 +150,7 @@ nsresult txXSLTNumber::getValueList(Element* aNumberElement,
|
||||||
switch (currNode->getNodeType()) {
|
switch (currNode->getNodeType()) {
|
||||||
case Node::ELEMENT_NODE:
|
case Node::ELEMENT_NODE:
|
||||||
{
|
{
|
||||||
txAtom* localName = 0;
|
nsIAtom* localName = 0;
|
||||||
currNode->getLocalName(&localName);
|
currNode->getLocalName(&localName);
|
||||||
nodeTest = new txNameTest(0, localName,
|
nodeTest = new txNameTest(0, localName,
|
||||||
currNode->getNamespaceID(),
|
currNode->getNamespaceID(),
|
||||||
|
@ -218,7 +218,7 @@ nsresult txXSLTNumber::getValueList(Element* aNumberElement,
|
||||||
// Generate list of values depending on the value of the level-attribute
|
// Generate list of values depending on the value of the level-attribute
|
||||||
|
|
||||||
nsAutoString levelStr;
|
nsAutoString levelStr;
|
||||||
txAtom* level = 0;
|
nsIAtom* level = 0;
|
||||||
if (aNumberElement->getAttr(txXSLTAtoms::level, kNameSpaceID_None, levelStr)) {
|
if (aNumberElement->getAttr(txXSLTAtoms::level, kNameSpaceID_None, levelStr)) {
|
||||||
level = TX_GET_ATOM(levelStr);
|
level = TX_GET_ATOM(levelStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ private:
|
||||||
class txKeyPattern : public txPattern
|
class txKeyPattern : public txPattern
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txKeyPattern(ProcessorState* aPs, txAtom* aPrefix, txAtom* aLocalName,
|
txKeyPattern(ProcessorState* aPs, nsIAtom* aPrefix, nsIAtom* aLocalName,
|
||||||
PRInt32 aNSID, const nsAString& aValue)
|
PRInt32 aNSID, const nsAString& aValue)
|
||||||
: mProcessorState(aPs), mName(aNSID, aLocalName), mPrefix(aPrefix),
|
: mProcessorState(aPs), mName(aNSID, aLocalName), mPrefix(aPrefix),
|
||||||
mValue(aValue)
|
mValue(aValue)
|
||||||
|
@ -186,7 +186,7 @@ public:
|
||||||
private:
|
private:
|
||||||
ProcessorState* mProcessorState;
|
ProcessorState* mProcessorState;
|
||||||
txExpandedName mName;
|
txExpandedName mName;
|
||||||
txAtom* mPrefix;
|
nsIAtom* mPrefix;
|
||||||
nsString mValue;
|
nsString mValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче