|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.caja.parser.html.AttributeNameFixup
final class AttributeNameFixup
Maps XML qualified names like prefix:localName
including ones in the
special xmlns:namespaceName
namespace to valid XML local names
f:fixupName
.
This lets us shuttle names through several stages:
Html5ElementStack
where we know attribute names but not
where elements begin and end.
In this stage, XML elements and attributes have a no namespace and a local name containing a colon.
CajaTreeBuilder
which builds a DOM that cannot
have attributes whose names start with xmlns:
. At this stage,
we do not have all the parent context to make namespace declarations, so
we shuttle names outside the default HTML namespace into non namespaced
elements.
The Xerces DOM implementation can deal with ':'
s in local names
for non-namespaced elements and attributes, but rejects any attributes
whose names start with xmlns:
.
In this stage, XML elements and attributes have a no namespace and a local name containing a colon.
DomParser
which walks the resulting DOM to find elements
and attributes with namespace prefixes that need to be fixed and rewrites
them.
After this stage finishes, all elements and attributes are properly namespaced.
DomParser.fixup(org.w3c.dom.Node, com.google.caja.parser.html.Namespaces)
Field Summary | |
---|---|
(package private) static java.lang.String |
PREFIX
A prefix of all names of attributes that need to be fixed up. |
(package private) static java.lang.String |
XMLNS_PREFIX
A prefix of all fixup names that are encoded namespace declarations. |
Constructor Summary | |
---|---|
AttributeNameFixup()
|
Method Summary | |
---|---|
(package private) static java.lang.String |
fixupNameFromQname(java.lang.String qname)
|
(package private) static java.lang.String |
qnameFromFixupName(java.lang.String fixupName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final java.lang.String PREFIX
static final java.lang.String XMLNS_PREFIX
Constructor Detail |
---|
AttributeNameFixup()
Method Detail |
---|
static java.lang.String fixupNameFromQname(java.lang.String qname)
static java.lang.String qnameFromFixupName(java.lang.String fixupName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |