jlibs.xml.sax.helpers
Class MyNamespaceSupport
java.lang.Object
org.xml.sax.helpers.NamespaceSupport
jlibs.xml.sax.helpers.MyNamespaceSupport
public class MyNamespaceSupport
- extends org.xml.sax.helpers.NamespaceSupport
- Author:
- Santhosh Kumar T
| Methods inherited from class org.xml.sax.helpers.NamespaceSupport |
declarePrefix, getPrefix, getURI, isNamespaceDeclUris, popContext, processName, pushContext, reset, setNamespaceDeclUris |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MyNamespaceSupport
public MyNamespaceSupport()
MyNamespaceSupport
public MyNamespaceSupport(Properties suggested)
suggestPrefix
public void suggestPrefix(String prefix,
String uri)
- This method is used to override the prefix generated by
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
findPrefix
public String findPrefix(String uri)
- Return one of the prefixes mapped to a Namespace 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.
findURI
public String findURI(String prefix)
getSuggestPrefix
public String getSuggestPrefix()
setSuggestPrefix
public void setSuggestPrefix(String suggestPrefix)
declarePrefix
public String declarePrefix(String uri)
- generated a new prefix and binds it to given uri.
you can customize the generated prefix using suggestPrefix(String, String)
getPrefixes
public Enumeration<String> getPrefixes(String uri)
- Overrides:
getPrefixes in class org.xml.sax.helpers.NamespaceSupport
getPrefixes
public Enumeration<String> getPrefixes()
- Overrides:
getPrefixes in class org.xml.sax.helpers.NamespaceSupport
getDeclaredPrefixes
public Enumeration<String> getDeclaredPrefixes()
- Overrides:
getDeclaredPrefixes in class org.xml.sax.helpers.NamespaceSupport
isDeclaredPrefix
public boolean isDeclaredPrefix(String prefix)
toQName
public QName toQName(String qname)
toQName
public String toQName(String uri,
String localName)
startDocument
public void startDocument()
startPrefixMapping
public void startPrefixMapping(String prefix,
String uri)
startPrefixMapping
public String startPrefixMapping(String uri)
startElement
public void startElement()
endElement
public void endElement()
main
public static void main(String[] args)
Copyright © 2015. All rights reserved.