724 * [42] ETag ::= '</' Name S? '>'
725 * </pre>
726 * <p>
727 * <strong>Note:</strong> This method uses the fElementQName variable.
728 * The contents of this variable will be destroyed. The caller should
729 * copy the needed information out of this variable before calling
730 * this method.
731 *
732 * @return The element depth.
733 */
734 protected int scanEndElement() throws IOException, XNIException {
735 if (DEBUG_START_END_ELEMENT)
736 System.out.println(">>> scanEndElement()");
737
738 // pop context
739 QName endElementName = fElementStack.popElement();
740
741 // Take advantage of the fact that next string _should_ be "fElementQName.rawName",
742 //In scanners most of the time is consumed on checks done for XML characters, we can
743 // optimize on it and avoid the checks done for endElement,
744 //we will also avoid symbol table lookup - neeraj.bajaj@sun.com
745
746 // this should work both for namespace processing true or false...
747
748 //REVISIT: if the string is not the same as expected.. we need to do better error handling..
749 //We can skip this for now... In any case if the string doesn't match -- document is not well formed.
750
751 if (!fEntityScanner.skipString(endElementName.rawname)) {
752 reportFatalError(
753 "ETagRequired",
754 new Object[] { endElementName.rawname });
755 }
756
757 // end
758 fEntityScanner.skipSpaces();
759 if (!fEntityScanner.skipChar('>', NameType.ELEMENTEND)) {
760 reportFatalError(
761 "ETagUnterminated",
762 new Object[] { endElementName.rawname });
763 }
764 fMarkupDepth--;
|
724 * [42] ETag ::= '</' Name S? '>'
725 * </pre>
726 * <p>
727 * <strong>Note:</strong> This method uses the fElementQName variable.
728 * The contents of this variable will be destroyed. The caller should
729 * copy the needed information out of this variable before calling
730 * this method.
731 *
732 * @return The element depth.
733 */
734 protected int scanEndElement() throws IOException, XNIException {
735 if (DEBUG_START_END_ELEMENT)
736 System.out.println(">>> scanEndElement()");
737
738 // pop context
739 QName endElementName = fElementStack.popElement();
740
741 // Take advantage of the fact that next string _should_ be "fElementQName.rawName",
742 //In scanners most of the time is consumed on checks done for XML characters, we can
743 // optimize on it and avoid the checks done for endElement,
744 //we will also avoid symbol table lookup.
745
746 // this should work both for namespace processing true or false...
747
748 //REVISIT: if the string is not the same as expected.. we need to do better error handling..
749 //We can skip this for now... In any case if the string doesn't match -- document is not well formed.
750
751 if (!fEntityScanner.skipString(endElementName.rawname)) {
752 reportFatalError(
753 "ETagRequired",
754 new Object[] { endElementName.rawname });
755 }
756
757 // end
758 fEntityScanner.skipSpaces();
759 if (!fEntityScanner.skipChar('>', NameType.ELEMENTEND)) {
760 reportFatalError(
761 "ETagUnterminated",
762 new Object[] { endElementName.rawname });
763 }
764 fMarkupDepth--;
|