public class MyNamespaceSupport extends org.xml.sax.helpers.NamespaceSupport
NSDECL, XMLNS| Constructor and Description |
|---|
MyNamespaceSupport() |
MyNamespaceSupport(Properties suggested) |
| Modifier and Type | Method and Description |
|---|---|
String |
declarePrefix(String uri)
generated a new prefix and binds it to given uri.
|
void |
endElement() |
String |
findPrefix(String uri)
Return one of the prefixes mapped to a Namespace URI.
|
String |
findURI(String prefix) |
Enumeration<String> |
getDeclaredPrefixes() |
Enumeration<String> |
getPrefixes() |
Enumeration<String> |
getPrefixes(String uri) |
String |
getSuggestPrefix() |
boolean |
isDeclaredPrefix(String prefix) |
static void |
main(String[] args) |
void |
setSuggestPrefix(String suggestPrefix) |
void |
startDocument() |
void |
startElement() |
String |
startPrefixMapping(String uri) |
void |
startPrefixMapping(String prefix,
String uri) |
void |
suggestPrefix(String prefix,
String uri)
This method is used to override the prefix generated by
declarePrefix(String), to your own choice. |
QName |
toQName(String qname) |
String |
toQName(String uri,
String localName) |
declarePrefix, getPrefix, getURI, isNamespaceDeclUris, popContext, processName, pushContext, reset, setNamespaceDeclUrispublic MyNamespaceSupport()
public MyNamespaceSupport(Properties suggested)
public void suggestPrefix(String prefix, String uri)
declarePrefix(String), to your own choice.
if the suggested prefix already exists, then it will generate new prefix, from suggested prefix by appending a number
public String findPrefix(String uri)
If more than one prefix is currently mapped to the same URI, this method will make an arbitrary selection;
Unlike NamespaceSupport.getPrefix(String) this method, this returns empty
prefix if the given uri is bound to default prefix.
public String getSuggestPrefix()
public void setSuggestPrefix(String suggestPrefix)
public String declarePrefix(String uri)
you can customize the generated prefix using suggestPrefix(String, String)
public Enumeration<String> getPrefixes(String uri)
getPrefixes in class org.xml.sax.helpers.NamespaceSupportpublic Enumeration<String> getPrefixes()
getPrefixes in class org.xml.sax.helpers.NamespaceSupportpublic Enumeration<String> getDeclaredPrefixes()
getDeclaredPrefixes in class org.xml.sax.helpers.NamespaceSupportpublic boolean isDeclaredPrefix(String prefix)
public void startDocument()
public void startElement()
public void endElement()
public static void main(String[] args)
Copyright © 2019. All rights reserved.