зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug 105808 (We need atomtables for all xslt elements and attributes). r=Pike, sicking, sr=jst.
This commit is contained in:
Родитель
22667910ed
Коммит
61344cb748
|
@ -43,7 +43,8 @@ CPPSRCS = ArrayList.cpp \
|
|||
SimpleErrorObserver.cpp \
|
||||
Stack.cpp \
|
||||
StringList.cpp \
|
||||
Tokenizer.cpp
|
||||
Tokenizer.cpp \
|
||||
txAtoms.cpp
|
||||
|
||||
ifdef TX_EXE
|
||||
CPPSRCS += CommandLineUtils.cpp \
|
||||
|
@ -51,6 +52,9 @@ ifdef TX_EXE
|
|||
else
|
||||
CPPSRCS += MozillaString.cpp
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
INCLUDES += -I$(srcdir)/../xpath -I$(srcdir)/../xslt
|
||||
|
||||
install:: $(OBJS)
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
/* -*- 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
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
|
||||
#include "txAtoms.h"
|
||||
|
||||
#define TX_ATOM(_name, _value) txAtom* txXMLAtoms::_name = 0
|
||||
XML_ATOMS;
|
||||
#undef TX_ATOM
|
||||
#define TX_ATOM(_name, _value) txAtom* txXPathAtoms::_name = 0
|
||||
#include "txXPathAtomList.h"
|
||||
#undef TX_ATOM
|
||||
#define TX_ATOM(_name, _value) txAtom* txXSLTAtoms::_name = 0
|
||||
#include "txXSLTAtomList.h"
|
||||
#undef TX_ATOM
|
||||
#ifndef TX_EXE
|
||||
#define TX_ATOM(_name, _value) txAtom* txHTMLAtoms::_name = 0
|
||||
#include "txHTMLAtomList.h"
|
||||
#undef TX_ATOM
|
||||
#endif
|
||||
|
||||
static PRUint32 gXMLRefCnt = 0;
|
||||
static PRUint32 gXPathRefCnt = 0;
|
||||
static PRUint32 gXSLTRefCnt = 0;
|
||||
#ifndef TX_EXE
|
||||
static PRUint32 gHTMLRefCnt = 0;
|
||||
#endif
|
||||
|
||||
#ifdef TX_EXE
|
||||
#define TX_ATOM(_name, _value) \
|
||||
_name = TX_GET_ATOM(String(_value)); \
|
||||
if (!_name) \
|
||||
return MB_FALSE
|
||||
#else
|
||||
#define TX_ATOM(_name, _value) \
|
||||
_name = NS_NewAtom(_value); \
|
||||
NS_ENSURE_TRUE(_name, MB_FALSE)
|
||||
#endif
|
||||
|
||||
MBool txXMLAtoms::init()
|
||||
{
|
||||
if (0 == gXMLRefCnt++) {
|
||||
// create atoms
|
||||
XML_ATOMS;
|
||||
}
|
||||
return MB_TRUE;
|
||||
}
|
||||
|
||||
MBool txXPathAtoms::init()
|
||||
{
|
||||
if (0 == gXPathRefCnt++) {
|
||||
// create atoms
|
||||
#include "txXPathAtomList.h"
|
||||
}
|
||||
return MB_TRUE;
|
||||
}
|
||||
|
||||
MBool txXSLTAtoms::init()
|
||||
{
|
||||
if (0 == gXSLTRefCnt++) {
|
||||
// create atoms
|
||||
#include "txXSLTAtomList.h"
|
||||
}
|
||||
return MB_TRUE;
|
||||
}
|
||||
|
||||
#ifndef TX_EXE
|
||||
MBool txHTMLAtoms::init()
|
||||
{
|
||||
if (0 == gHTMLRefCnt++) {
|
||||
// create atoms
|
||||
#include "txHTMLAtomList.h"
|
||||
}
|
||||
return MB_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef TX_ATOM
|
||||
|
||||
#define TX_ATOM(_name, _value) \
|
||||
TX_IF_RELEASE_ATOM(_name)
|
||||
|
||||
void txXMLAtoms::shutdown()
|
||||
{
|
||||
NS_ASSERTION(gXMLRefCnt != 0, "bad release atoms");
|
||||
if (--gXMLRefCnt == 0) {
|
||||
// release atoms
|
||||
XML_ATOMS;
|
||||
}
|
||||
}
|
||||
|
||||
void txXPathAtoms::shutdown()
|
||||
{
|
||||
NS_ASSERTION(gXPathRefCnt != 0, "bad release atoms");
|
||||
if (--gXPathRefCnt == 0) {
|
||||
// release atoms
|
||||
#include "txXPathAtomList.h"
|
||||
}
|
||||
}
|
||||
|
||||
void txXSLTAtoms::shutdown()
|
||||
{
|
||||
NS_ASSERTION(gXSLTRefCnt != 0, "bad release atoms");
|
||||
if (--gXSLTRefCnt == 0) {
|
||||
// release atoms
|
||||
#include "txXSLTAtomList.h"
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef TX_EXE
|
||||
void txHTMLAtoms::shutdown()
|
||||
{
|
||||
NS_ASSERTION(gHTMLRefCnt != 0, "bad release atoms");
|
||||
if (--gHTMLRefCnt == 0) {
|
||||
// release atoms
|
||||
#include "txHTMLAtomList.h"
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef TX_ATOM
|
|
@ -0,0 +1,98 @@
|
|||
/* -*- 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
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
#ifndef TRANSFRMX_ATOMS_H
|
||||
#define TRANSFRMX_ATOMS_H
|
||||
|
||||
#include "txAtom.h"
|
||||
|
||||
/*
|
||||
* Declare all atoms
|
||||
*
|
||||
* The atom names and values are stored in tx*AtomList.h and
|
||||
* are brought to you by the magic of C preprocessing.
|
||||
* Add new atoms to tx*AtomList.h and all support logic will
|
||||
* be auto-generated.
|
||||
*/
|
||||
|
||||
#define XML_ATOMS \
|
||||
TX_ATOM(base, "base"); \
|
||||
TX_ATOM(lang, "lang"); \
|
||||
TX_ATOM(space, "space"); \
|
||||
TX_ATOM(xml, "xml"); \
|
||||
TX_ATOM(xmlns, "xmlns")
|
||||
|
||||
#define TX_ATOM(_name, _value) static txAtom* _name
|
||||
|
||||
class txXMLAtoms
|
||||
{
|
||||
public:
|
||||
static MBool init();
|
||||
static void shutdown();
|
||||
XML_ATOMS;
|
||||
};
|
||||
|
||||
class txXPathAtoms
|
||||
{
|
||||
public:
|
||||
static MBool init();
|
||||
static void shutdown();
|
||||
#include "txXPathAtomList.h"
|
||||
};
|
||||
|
||||
class txXSLTAtoms
|
||||
{
|
||||
public:
|
||||
static MBool init();
|
||||
static void shutdown();
|
||||
#include "txXSLTAtomList.h"
|
||||
};
|
||||
|
||||
#ifndef TX_EXE
|
||||
class txHTMLAtoms
|
||||
{
|
||||
public:
|
||||
static MBool init();
|
||||
static void shutdown();
|
||||
#include "txHTMLAtomList.h"
|
||||
};
|
||||
#endif
|
||||
|
||||
#undef TX_ATOM
|
||||
|
||||
#endif
|
|
@ -40,6 +40,7 @@ OBJS =../base/ArrayList.$(OBJ_SUFFIX) \
|
|||
../base/Stack.$(OBJ_SUFFIX) \
|
||||
../base/StringList.$(OBJ_SUFFIX) \
|
||||
../base/Tokenizer.$(OBJ_SUFFIX) \
|
||||
../base/txAtoms.$(OBJ_SUFFIX) \
|
||||
../base/TxString.$(OBJ_SUFFIX) \
|
||||
../net/URIUtils.$(OBJ_SUFFIX) \
|
||||
../xml/dom/standalone/Attr.$(OBJ_SUFFIX) \
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
//
|
||||
|
||||
#include "dom.h"
|
||||
#include "txAtom.h"
|
||||
#include "txAtoms.h"
|
||||
|
||||
//
|
||||
//Construct an Attribute object using the specified name and document owner
|
||||
|
@ -39,7 +39,7 @@ Attr::Attr(const String& name, Document* owner):
|
|||
int idx = nodeName.indexOf(':');
|
||||
if (idx == NOT_FOUND) {
|
||||
mLocalName = TX_GET_ATOM(nodeName);
|
||||
if (mLocalName == txXMLAtoms::XMLNSPrefix)
|
||||
if (mLocalName == txXMLAtoms::xmlns)
|
||||
mNamespaceID = kNameSpaceID_XMLNS;
|
||||
else
|
||||
mNamespaceID = kNameSpaceID_None;
|
||||
|
@ -54,13 +54,13 @@ Attr::Attr(const String& name, Document* owner):
|
|||
String prefix;
|
||||
nodeName.subString(0, idx, prefix);
|
||||
txAtom* prefixAtom = TX_GET_ATOM(prefix);
|
||||
if (prefixAtom == txXMLAtoms::XMLNSPrefix)
|
||||
if (prefixAtom == txXMLAtoms::xmlns)
|
||||
mNamespaceID = kNameSpaceID_XMLNS;
|
||||
else if (prefixAtom == txXMLAtoms::XMLPrefix)
|
||||
else if (prefixAtom == txXMLAtoms::xml)
|
||||
mNamespaceID = kNameSpaceID_XML;
|
||||
else
|
||||
mNamespaceID = kNameSpaceID_Unknown;
|
||||
TX_RELEASE_IF_ATOM(prefixAtom);
|
||||
TX_IF_RELEASE_ATOM(prefixAtom);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ Attr::Attr(const String& name, Document* owner):
|
|||
//
|
||||
Attr::~Attr()
|
||||
{
|
||||
TX_RELEASE_IF_ATOM(mLocalName);
|
||||
TX_IF_RELEASE_ATOM(mLocalName);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -198,7 +198,7 @@ PRInt32 Attr::getNamespaceID()
|
|||
nodeName.subString(0, idx, prefix);
|
||||
txAtom* prefixAtom = TX_GET_ATOM(prefix);
|
||||
mNamespaceID = lookupNamespaceID(prefixAtom);
|
||||
TX_RELEASE_IF_ATOM(prefixAtom);
|
||||
TX_IF_RELEASE_ATOM(prefixAtom);
|
||||
return mNamespaceID;
|
||||
}
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ class Node : public TxObject
|
|||
//txXPathNode functions
|
||||
virtual MBool getLocalName(txAtom** aLocalName) = 0;
|
||||
virtual PRInt32 getNamespaceID() = 0;
|
||||
virtual PRInt32 lookupNamespaceID(txAtom* prefix) = 0;
|
||||
virtual PRInt32 lookupNamespaceID(txAtom* aPrefix) = 0;
|
||||
virtual Node* getXPathParent() = 0;
|
||||
};
|
||||
|
||||
|
@ -670,7 +670,7 @@ class txNamespaceManager
|
|||
public:
|
||||
static PRInt32 getNamespaceID(const String& aURI)
|
||||
{
|
||||
if (!mNamespaces && !Init())
|
||||
if (!mNamespaces && !init())
|
||||
return kNameSpaceID_Unknown;
|
||||
txListIterator nameIter(mNamespaces);
|
||||
PRInt32 id=0;
|
||||
|
@ -695,7 +695,7 @@ public:
|
|||
// empty namespace, and errors
|
||||
if (aID <= 0)
|
||||
return NULL_STRING;
|
||||
if (!mNamespaces && !Init())
|
||||
if (!mNamespaces && !init())
|
||||
return NULL_STRING;
|
||||
txListIterator nameIter(mNamespaces);
|
||||
String* aURI = (String*)nameIter.advance(aID);
|
||||
|
@ -704,10 +704,10 @@ public:
|
|||
return NULL_STRING;
|
||||
}
|
||||
|
||||
static MBool Init()
|
||||
static MBool init()
|
||||
{
|
||||
NS_ASSERTION(!mNamespaces,
|
||||
"called without matching Shutdown()");
|
||||
"called without matching shutdown()");
|
||||
if (mNamespaces)
|
||||
return MB_TRUE;
|
||||
mNamespaces = new txList();
|
||||
|
@ -743,9 +743,9 @@ public:
|
|||
return MB_TRUE;
|
||||
}
|
||||
|
||||
static void Shutdown()
|
||||
static void shutdown()
|
||||
{
|
||||
NS_ASSERTION(mNamespaces, "called without matching Init()");
|
||||
NS_ASSERTION(mNamespaces, "called without matching init()");
|
||||
if (!mNamespaces)
|
||||
return;
|
||||
txListIterator iter(mNamespaces);
|
||||
|
@ -759,19 +759,7 @@ private:
|
|||
static txList* mNamespaces;
|
||||
};
|
||||
|
||||
//
|
||||
// Definition of txXMLAtoms
|
||||
//
|
||||
class txXMLAtoms
|
||||
{
|
||||
public:
|
||||
static txAtom* XMLPrefix;
|
||||
static txAtom* XMLNSPrefix;
|
||||
};
|
||||
|
||||
#define TX_IMPL_DOM_STATICS \
|
||||
txAtom* txXMLAtoms::XMLPrefix = 0; \
|
||||
txAtom* txXMLAtoms::XMLNSPrefix = 0; \
|
||||
txList* txNamespaceManager::mNamespaces = 0
|
||||
txList* txNamespaceManager::mNamespaces = 0
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,9 +26,7 @@
|
|||
//
|
||||
|
||||
#include "dom.h"
|
||||
#include "txAtom.h"
|
||||
|
||||
const String XMLNS_ATTR = "xmlns";
|
||||
#include "txAtoms.h"
|
||||
|
||||
//
|
||||
//Construct a new element with the specified tagName and Document owner.
|
||||
|
@ -59,7 +57,7 @@ Element::Element(const String& tagName, Document* owner) :
|
|||
Element::~Element()
|
||||
{
|
||||
mAttributes.clear();
|
||||
TX_RELEASE_IF_ATOM(mLocalName);
|
||||
TX_IF_RELEASE_ATOM(mLocalName);
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -86,8 +84,8 @@ PRInt32 Element::getNamespaceID()
|
|||
Node* node = this;
|
||||
while (node && node->getNodeType() == Node::ELEMENT_NODE) {
|
||||
String nsURI;
|
||||
if (((Element*)node)->getAttr(txXMLAtoms::XMLNSPrefix,
|
||||
kNameSpaceID_XMLNS, nsURI)) {
|
||||
if (((Element*)node)->getAttr(txXMLAtoms::xmlns, kNameSpaceID_XMLNS,
|
||||
nsURI)) {
|
||||
// xmlns = "" sets the default namespace ID to kNameSpaceID_None;
|
||||
if (!nsURI.isEmpty()) {
|
||||
mNamespaceID = txNamespaceManager::getNamespaceID(nsURI);
|
||||
|
@ -106,7 +104,7 @@ PRInt32 Element::getNamespaceID()
|
|||
nodeName.subString(0, idx, prefix);
|
||||
txAtom* prefixAtom = TX_GET_ATOM(prefix);
|
||||
mNamespaceID = lookupNamespaceID(prefixAtom);
|
||||
TX_RELEASE_IF_ATOM(prefixAtom);
|
||||
TX_IF_RELEASE_ATOM(prefixAtom);
|
||||
}
|
||||
return mNamespaceID;
|
||||
}
|
||||
|
@ -222,10 +220,10 @@ MBool Element::getAttr(txAtom* aLocalName, PRInt32 aNSID,
|
|||
aNSID == attrNode->getNamespaceID() &&
|
||||
aLocalName == localName) {
|
||||
aValue.append(attrNode->getValue());
|
||||
TX_RELEASE_IF_ATOM(localName);
|
||||
TX_IF_RELEASE_ATOM(localName);
|
||||
return MB_TRUE;
|
||||
}
|
||||
TX_RELEASE_IF_ATOM(localName);
|
||||
TX_IF_RELEASE_ATOM(localName);
|
||||
item = item->next;
|
||||
}
|
||||
return MB_FALSE;
|
||||
|
|
|
@ -32,10 +32,7 @@
|
|||
#include "dom.h"
|
||||
#include "ArrayList.h"
|
||||
#include "URIUtils.h"
|
||||
#include "txAtom.h"
|
||||
|
||||
const String XMLBASE_ATTR = "xml:base";
|
||||
const String XMLNS_ATTR = "xmlns";
|
||||
#include "txAtoms.h"
|
||||
|
||||
NodeDefinition::NodeDefinition(NodeType type, const String& name,
|
||||
const String& value, Document* owner)
|
||||
|
@ -379,15 +376,15 @@ PRInt32 NodeDefinition::getNamespaceID()
|
|||
//
|
||||
// @return namespace associated with prefix
|
||||
//
|
||||
PRInt32 NodeDefinition::lookupNamespaceID(txAtom* prefix)
|
||||
PRInt32 NodeDefinition::lookupNamespaceID(txAtom* aPrefix)
|
||||
{
|
||||
// this is http://www.w3.org/2000/xmlns/,
|
||||
// ID = kNameSpaceID_XMLNS, see txNamespaceManager::Init
|
||||
if (prefix == txXMLAtoms::XMLNSPrefix)
|
||||
if (aPrefix == txXMLAtoms::xmlns)
|
||||
return kNameSpaceID_XMLNS;
|
||||
// this is http://www.w3.org/XML/1998/namespace,
|
||||
// ID = kNameSpaceID_XML, see txNamespaceManager::Init
|
||||
if (prefix == txXMLAtoms::XMLPrefix)
|
||||
if (aPrefix == txXMLAtoms::xml)
|
||||
return kNameSpaceID_XML;
|
||||
|
||||
Node* node = this;
|
||||
|
@ -396,7 +393,7 @@ PRInt32 NodeDefinition::lookupNamespaceID(txAtom* prefix)
|
|||
|
||||
String name("xmlns:");
|
||||
String prefixString;
|
||||
TX_GET_ATOM_STRING(prefix,prefixString);
|
||||
TX_GET_ATOM_STRING(aPrefix, prefixString);
|
||||
name.append(prefixString);
|
||||
Attr* xmlns;
|
||||
while (node && node->getNodeType() == Node::ELEMENT_NODE) {
|
||||
|
@ -430,14 +427,14 @@ String NodeDefinition::getBaseURI()
|
|||
Node* node = this;
|
||||
ArrayList baseUrls;
|
||||
String url;
|
||||
Node* xbAttr;
|
||||
String attValue;
|
||||
|
||||
while (node) {
|
||||
switch (node->getNodeType()) {
|
||||
case Node::ELEMENT_NODE :
|
||||
xbAttr = ((Element*)node)->getAttributeNode(XMLBASE_ATTR);
|
||||
if (xbAttr)
|
||||
baseUrls.add(new String(xbAttr->getNodeValue()));
|
||||
if (((Element*)node)->getAttr(txXMLAtoms::base, kNameSpaceID_XML,
|
||||
attValue))
|
||||
baseUrls.add(new String(attValue));
|
||||
break;
|
||||
|
||||
case Node::DOCUMENT_NODE :
|
||||
|
|
|
@ -49,7 +49,7 @@ ProcessingInstruction::ProcessingInstruction(const String& theTarget,
|
|||
//
|
||||
ProcessingInstruction::~ProcessingInstruction()
|
||||
{
|
||||
TX_RELEASE_IF_ATOM(mLocalName);
|
||||
TX_IF_RELEASE_ATOM(mLocalName);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
/* -*- 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>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
TX_ATOM(_asterix, "*");
|
||||
TX_ATOM(boolean, "boolean");
|
||||
TX_ATOM(ceiling, "ceiling");
|
||||
TX_ATOM(concat, "concat");
|
||||
TX_ATOM(contains, "contains");
|
||||
TX_ATOM(count, "count");
|
||||
TX_ATOM(_false, "false");
|
||||
TX_ATOM(floor, "floor");
|
||||
TX_ATOM(id, "id");
|
||||
TX_ATOM(lang, "lang");
|
||||
TX_ATOM(last, "last");
|
||||
TX_ATOM(localName, "local-name");
|
||||
TX_ATOM(name, "name");
|
||||
TX_ATOM(namespaceUri, "namespace-uri");
|
||||
TX_ATOM(normalizeSpace, "normalize-space");
|
||||
TX_ATOM(_not, "not");
|
||||
TX_ATOM(number, "number");
|
||||
TX_ATOM(position, "position");
|
||||
TX_ATOM(round, "round");
|
||||
TX_ATOM(startsWith, "starts-with");
|
||||
TX_ATOM(string, "string");
|
||||
TX_ATOM(stringLength, "string-length");
|
||||
TX_ATOM(substring, "substring");
|
||||
TX_ATOM(substringAfter, "substring-after");
|
||||
TX_ATOM(substringBefore, "substring-before");
|
||||
TX_ATOM(sum, "sum");
|
||||
TX_ATOM(translate, "translate");
|
||||
TX_ATOM(_true, "true");
|
||||
|
||||
// XPath Axes
|
||||
TX_ATOM(ancestor, "ancestor");
|
||||
TX_ATOM(ancestorOrSelf, "ancestor-or-self");
|
||||
TX_ATOM(attribute, "attribute");
|
||||
TX_ATOM(child, "child");
|
||||
TX_ATOM(descendant, "descendant");
|
||||
TX_ATOM(descendantOrSelf, "descendant-or-self");
|
||||
TX_ATOM(following, "following");
|
||||
TX_ATOM(followingSibling, "following-sibling");
|
||||
TX_ATOM(_namespace, "namespace");
|
||||
TX_ATOM(parent, "parent");
|
||||
TX_ATOM(preceding, "preceding");
|
||||
TX_ATOM(precedingSibling, "preceding-sibling");
|
||||
TX_ATOM(self, "self");
|
|
@ -0,0 +1,47 @@
|
|||
/* -*- 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
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Peter Van der Beken <peterv@netscape.com>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
TX_ATOM(headerDefaultStyle, "default-style");
|
||||
TX_ATOM(media, "media");
|
||||
TX_ATOM(script, "script");
|
||||
TX_ATOM(src, "src");
|
||||
TX_ATOM(style, "style");
|
||||
TX_ATOM(table, "table");
|
||||
TX_ATOM(textarea, "textarea");
|
||||
TX_ATOM(title, "title");
|
||||
TX_ATOM(type, "type");
|
|
@ -0,0 +1,125 @@
|
|||
/* -*- 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>
|
||||
*
|
||||
* 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 ***** */
|
||||
|
||||
// XSLT elements
|
||||
TX_ATOM(applyImports, "apply-imports");
|
||||
TX_ATOM(applyTemplates, "apply-templates");
|
||||
TX_ATOM(attribute, "attribute");
|
||||
TX_ATOM(attributeSet, "attribute-set");
|
||||
TX_ATOM(callTemplate, "call-template");
|
||||
TX_ATOM(choose, "choose");
|
||||
TX_ATOM(comment, "comment");
|
||||
TX_ATOM(copy, "copy");
|
||||
TX_ATOM(copyOf, "copy-of");
|
||||
TX_ATOM(decimalFormat, "decimal-format");
|
||||
TX_ATOM(element, "element");
|
||||
TX_ATOM(forEach, "for-each");
|
||||
TX_ATOM(_if, "if");
|
||||
TX_ATOM(import, "import");
|
||||
TX_ATOM(include, "include");
|
||||
TX_ATOM(key, "key");
|
||||
TX_ATOM(message, "message");
|
||||
TX_ATOM(number, "number");
|
||||
TX_ATOM(otherwise, "otherwise");
|
||||
TX_ATOM(output, "output");
|
||||
TX_ATOM(param, "param");
|
||||
TX_ATOM(processingInstruction, "processing-instruction");
|
||||
TX_ATOM(preserveSpace, "preserve-space");
|
||||
TX_ATOM(sort, "sort");
|
||||
TX_ATOM(stripSpace, "strip-space");
|
||||
TX_ATOM(stylesheet, "stylesheet");
|
||||
TX_ATOM(_template, "template");
|
||||
TX_ATOM(text, "text");
|
||||
TX_ATOM(transform, "transform");
|
||||
TX_ATOM(valueOf, "value-of");
|
||||
TX_ATOM(variable, "variable");
|
||||
TX_ATOM(when, "when");
|
||||
TX_ATOM(withParam, "with-param");
|
||||
|
||||
// XSLT attributes
|
||||
TX_ATOM(case_order, "case-order");
|
||||
TX_ATOM(cdataSectionElements, "cdata-section-elements");
|
||||
TX_ATOM(count, "count");
|
||||
TX_ATOM(dataType, "data-type");
|
||||
TX_ATOM(decimalSeparator, "decimal-separator");
|
||||
TX_ATOM(defaultSpace, "default-space");
|
||||
TX_ATOM(digit, "digit");
|
||||
TX_ATOM(doctypePublic, "doctype-public");
|
||||
TX_ATOM(doctypeSystem, "doctype-system");
|
||||
TX_ATOM(elements, "elements");
|
||||
TX_ATOM(encoding, "encoding");
|
||||
TX_ATOM(format, "format");
|
||||
TX_ATOM(from, "from");
|
||||
TX_ATOM(groupingSeparator, "grouping-separator");
|
||||
TX_ATOM(href, "href");
|
||||
TX_ATOM(indent, "indent");
|
||||
TX_ATOM(infinity, "infinity");
|
||||
TX_ATOM(lang, "lang");
|
||||
TX_ATOM(level, "level");
|
||||
TX_ATOM(match, "match");
|
||||
TX_ATOM(method, "method");
|
||||
TX_ATOM(mediaType, "media-type");
|
||||
TX_ATOM(minusSign, "minus-sign");
|
||||
TX_ATOM(mode, "mode");
|
||||
TX_ATOM(name, "name");
|
||||
TX_ATOM(_namespace, "namespace");
|
||||
TX_ATOM(NaN, "NaN");
|
||||
TX_ATOM(omitXmlDeclaration, "omit-xml-declaration");
|
||||
TX_ATOM(order, "order");
|
||||
TX_ATOM(patternSeparator, "pattern-separator");
|
||||
TX_ATOM(perMille, "per-mille");
|
||||
TX_ATOM(percent, "percent");
|
||||
TX_ATOM(priority, "priority");
|
||||
TX_ATOM(select, "select");
|
||||
TX_ATOM(standalone, "standalone");
|
||||
TX_ATOM(test, "test");
|
||||
TX_ATOM(use, "use");
|
||||
TX_ATOM(useAttributeSets, "use-attribute-sets");
|
||||
TX_ATOM(value, "value");
|
||||
TX_ATOM(version, "version");
|
||||
TX_ATOM(zeroDigit, "zero-digit");
|
||||
|
||||
// XSLT functions
|
||||
TX_ATOM(current, "current");
|
||||
TX_ATOM(document, "document");
|
||||
TX_ATOM(elementAvailable, "element-available");
|
||||
TX_ATOM(formatNumber, "format-number");
|
||||
TX_ATOM(functionAvailable, "function-available");
|
||||
TX_ATOM(generateId, "generate-id");
|
||||
TX_ATOM(unparsedEntityUri, "unparsed-entity-uri");
|
||||
TX_ATOM(systemProperty, "system-property");
|
Загрузка…
Ссылка в новой задаче