UpperCaseFilterpublic class UpperCaseFilter extends PassThroughFilter This sample demonstrates how to create a filter for the document
"streaming" information set that turns element names into upper
case.
Note: This sample does not contain a
main method and cannot be run. It is only for
demonstration purposes. |
Fields Summary |
---|
private final org.apache.xerces.xni.QName | fQNameTemporary QName structure used by the toUpperCase
method. It should not be used anywhere else. |
Methods Summary |
---|
public void | emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)An empty element.
super.emptyElement(toUpperCase(element), attributes, augs);
| public void | endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs)The end of an element.
super.endElement(toUpperCase(element), augs);
| public void | startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs)The start of an element.
//
// XMLDocumentHandler methods
//
super.startElement(toUpperCase(element), attributes, augs);
| protected org.apache.xerces.xni.QName | toUpperCase(org.apache.xerces.xni.QName qname)This method upper-cases the prefix, localpart, and rawname
fields in the specified QName and returns a different
QName object containing the upper-cased string values.
String prefix = qname.prefix != null
? qname.prefix.toUpperCase() : null;
String localpart = qname.localpart != null
? qname.localpart.toUpperCase() : null;
String rawname = qname.rawname != null
? qname.rawname.toUpperCase() : null;
String uri = qname.uri;
fQName.setValues(prefix, localpart, rawname, uri);
return fQName;
|
|