1 57 package com.sun.org.apache.xerces.internal.jaxp.validation; 58 59 import com.sun.org.apache.xerces.internal.jaxp.XNI2SAX; 60 import com.sun.org.apache.xerces.internal.xni.Augmentations; 61 import com.sun.org.apache.xerces.internal.xni.QName; 62 import com.sun.org.apache.xerces.internal.xni.XMLAttributes; 63 import com.sun.org.apache.xerces.internal.xni.XNIException; 64 65 72 class XNI2SAXEx extends XNI2SAX { 73 74 private Augmentations fCurrentAugs; 75 private XMLAttributes fCurrentAtts; 76 77 82 public Augmentations getCurrentAugmentation() { 83 return fCurrentAugs; 84 } 85 86 89 public XMLAttributes getCurrentAttributes() { 90 if( fCurrentAtts==null ) throw new IllegalStateException (); 91 return fCurrentAtts; 92 } 93 94 public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { 95 try { 96 fCurrentAugs = augs; 97 fCurrentAtts = attributes; 98 super.startElement(element, attributes, augs); 99 } finally { 100 fCurrentAugs = null; 101 fCurrentAtts = null; 102 } 103 } 104 105 public void endElement(QName element, Augmentations augs) throws XNIException { 106 try { 107 fCurrentAugs = augs; 108 super.endElement(element, augs); 109 } finally { 110 fCurrentAugs = null; 111 } 112 } 113 114 public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException { 115 startElement(element,attributes,augs); 116 endElement(element,augs); 117 } 118 } 119 | Popular Tags |